Class: Btce::Types::Order
- Inherits:
-
Object
- Object
- Btce::Types::Order
- Defined in:
- lib/btce/types.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#pair ⇒ Object
readonly
Returns the value of attribute pair.
-
#rate ⇒ Object
readonly
Returns the value of attribute rate.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#timestamp_created ⇒ Object
readonly
Returns the value of attribute timestamp_created.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #active? ⇒ Boolean
-
#initialize(id, data) ⇒ Order
constructor
from Response.return.
- #to_s ⇒ Object
Constructor Details
#initialize(id, data) ⇒ Order
from Response.return
115 116 117 118 119 |
# File 'lib/btce/types.rb', line 115 def initialize(id, data) # from Response.return @values = data @values[:id] = id @values.each { |name, value| instance_variable_set("@#{name}", value) } end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
113 114 115 |
# File 'lib/btce/types.rb', line 113 def amount @amount end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
113 114 115 |
# File 'lib/btce/types.rb', line 113 def id @id end |
#pair ⇒ Object (readonly)
Returns the value of attribute pair.
113 114 115 |
# File 'lib/btce/types.rb', line 113 def pair @pair end |
#rate ⇒ Object (readonly)
Returns the value of attribute rate.
113 114 115 |
# File 'lib/btce/types.rb', line 113 def rate @rate end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
113 114 115 |
# File 'lib/btce/types.rb', line 113 def status @status end |
#timestamp_created ⇒ Object (readonly)
Returns the value of attribute timestamp_created.
113 114 115 |
# File 'lib/btce/types.rb', line 113 def @timestamp_created end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
113 114 115 |
# File 'lib/btce/types.rb', line 113 def type @type end |
Instance Method Details
#active? ⇒ Boolean
121 122 123 |
# File 'lib/btce/types.rb', line 121 def active? @values['status'].zero? ? false : true end |
#to_s ⇒ Object
125 126 127 |
# File 'lib/btce/types.rb', line 125 def to_s @values.to_s end |