Class: Bitmessage::ApiClient::Address
- Inherits:
-
Object
- Object
- Bitmessage::ApiClient::Address
- Defined in:
- lib/bitmessage/api_client.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#label ⇒ Object
Returns the value of attribute label.
-
#stream ⇒ Object
Returns the value of attribute stream.
Instance Method Summary collapse
-
#initialize(hash, label_encoded = false) ⇒ Address
constructor
A new instance of Address.
- #to_s ⇒ Object
Constructor Details
#initialize(hash, label_encoded = false) ⇒ Address
Returns a new instance of Address.
10 11 12 13 14 15 |
# File 'lib/bitmessage/api_client.rb', line 10 def initialize hash, label_encoded = false self.label = label_encoded ? Base64.decode64(hash['label']) : hash['label'] self.address = hash['address'] self.stream = hash['stream'] if hash.keys.include?('stream') self.enabled = hash['enabled'] end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
8 9 10 |
# File 'lib/bitmessage/api_client.rb', line 8 def address @address end |
#enabled ⇒ Object
Returns the value of attribute enabled.
8 9 10 |
# File 'lib/bitmessage/api_client.rb', line 8 def enabled @enabled end |
#label ⇒ Object
Returns the value of attribute label.
8 9 10 |
# File 'lib/bitmessage/api_client.rb', line 8 def label @label end |
#stream ⇒ Object
Returns the value of attribute stream.
8 9 10 |
# File 'lib/bitmessage/api_client.rb', line 8 def stream @stream end |
Instance Method Details
#to_s ⇒ Object
17 18 19 |
# File 'lib/bitmessage/api_client.rb', line 17 def to_s "#{self.label} (#{self.address})" end |