Class: Chaindotcom::Address

Inherits:
Object
  • Object
show all
Includes:
Ghostly
Defined in:
lib/chaindotcom/address.rb

Instance Attribute Summary collapse

Attributes included from Ghostly

#data_source, #load_state

Instance Method Summary collapse

Methods included from Ghostly

included, #load

Constructor Details

#initialize(attributes = {}) ⇒ Address

Returns a new instance of Address.



44
45
46
47
48
49
# File 'lib/chaindotcom/address.rb', line 44

def initialize(attributes={})
  attributes.each do |key, value|
    public_send("#{key}=", value)
  end
  @data_source ||= Chaindotcom::AddressMapper.new
end

Instance Attribute Details

#hashObject

Returns the value of attribute hash.



35
36
37
# File 'lib/chaindotcom/address.rb', line 35

def hash
  @hash
end

Instance Method Details

#==(other) ⇒ Object



55
56
57
# File 'lib/chaindotcom/address.rb', line 55

def ==(other)
  other.is_a?(Address) && other.hash == hash
end

#to_sObject



51
52
53
# File 'lib/chaindotcom/address.rb', line 51

def to_s
  inspect
end