Class: Heisencoin::Exchange
- Inherits:
-
Object
- Object
- Heisencoin::Exchange
- Defined in:
- lib/heisencoin/exchange.rb
Instance Attribute Summary collapse
-
#fee ⇒ Object
Returns the value of attribute fee.
-
#name ⇒ Object
Returns the value of attribute name.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #from_simple(simple) ⇒ Object
-
#initialize(simple = nil) ⇒ Exchange
constructor
A new instance of Exchange.
- #to_simple ⇒ Object
Constructor Details
#initialize(simple = nil) ⇒ Exchange
Returns a new instance of Exchange.
7 8 9 |
# File 'lib/heisencoin/exchange.rb', line 7 def initialize(simple = nil) from_simple(simple) if simple end |
Instance Attribute Details
#fee ⇒ Object
Returns the value of attribute fee.
5 6 7 |
# File 'lib/heisencoin/exchange.rb', line 5 def fee @fee end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/heisencoin/exchange.rb', line 5 def name @name end |
#time ⇒ Object
Returns the value of attribute time.
5 6 7 |
# File 'lib/heisencoin/exchange.rb', line 5 def time @time end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 |
# File 'lib/heisencoin/exchange.rb', line 21 def ==(other) self.name == other.name end |
#from_simple(simple) ⇒ Object
11 12 13 14 |
# File 'lib/heisencoin/exchange.rb', line 11 def from_simple(simple) @name = simple['name'] @fee = simple['fee'] end |
#to_simple ⇒ Object
16 17 18 19 |
# File 'lib/heisencoin/exchange.rb', line 16 def to_simple {'name' => name, 'fee' => fee} end |