Class: MailCapture::PingResult

Inherits:
Object
  • Object
show all
Defined in:
lib/mailcapture/models.rb

Overview

Response from ping.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ PingResult

Returns a new instance of PingResult.



90
91
92
93
94
95
# File 'lib/mailcapture/models.rb', line 90

def initialize(data)
  @status           = data['status']
  @username         = data['username']
  @address_template = data['address_template']
  @example          = data['example']
end

Instance Attribute Details

#address_templateString (readonly)

Returns template string — replace tag with your desired tag.

Returns:

  • (String)

    template string — replace tag with your desired tag



80
81
82
# File 'lib/mailcapture/models.rb', line 80

def address_template
  @address_template
end

#exampleString (readonly)

Returns a concrete example address.

Returns:

  • (String)

    a concrete example address



82
83
84
# File 'lib/mailcapture/models.rb', line 82

def example
  @example
end

#statusString (readonly)

Returns:

  • (String)


84
85
86
# File 'lib/mailcapture/models.rb', line 84

def status
  @status
end

#usernameString (readonly)

Returns your unique username.

Returns:

  • (String)

    your unique username



78
79
80
# File 'lib/mailcapture/models.rb', line 78

def username
  @username
end

Class Method Details

.from_hash(data) ⇒ Object



86
87
88
# File 'lib/mailcapture/models.rb', line 86

def self.from_hash(data)
  new(data)
end