Class: Vertpig::Summary
- Inherits:
-
Object
- Object
- Vertpig::Summary
- Includes:
- Helpers
- Defined in:
- lib/vertpig/summary.rb
Instance Attribute Summary collapse
-
#ask ⇒ Object
readonly
Returns the value of attribute ask.
-
#base_volume ⇒ Object
(also: #base_vol)
readonly
Returns the value of attribute base_volume.
-
#bid ⇒ Object
readonly
Returns the value of attribute bid.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#high ⇒ Object
readonly
Returns the value of attribute high.
-
#last ⇒ Object
readonly
Returns the value of attribute last.
-
#low ⇒ Object
readonly
Returns the value of attribute low.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#open_buy_orders ⇒ Object
readonly
Returns the value of attribute open_buy_orders.
-
#open_sell_orders ⇒ Object
readonly
Returns the value of attribute open_sell_orders.
-
#previous_day ⇒ Object
readonly
Returns the value of attribute previous_day.
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
-
#volume ⇒ Object
(also: #vol)
readonly
Returns the value of attribute volume.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Summary
constructor
A new instance of Summary.
Methods included from Helpers
Constructor Details
#initialize(attrs = {}) ⇒ Summary
Returns a new instance of Summary.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/vertpig/summary.rb', line 11 def initialize(attrs = {}) @name = attrs['MarketName'] @high = attrs['High'] @low = attrs['Low'] @volume = attrs['Volume'] @last = attrs['Last'] @base_volume = attrs['BaseVolume'] @bid = attrs['Bid'] @ask = attrs['Ask'] @open_buy_orders = attrs['OpenBuyOrders'] @open_sell_orders = attrs['OpenSellOrders'] @previous_day = attrs['PrevDay'] @updated_at = (attrs['TimeStamp']) @created_at = (attrs['Created']) @raw = attrs end |
Instance Attribute Details
#ask ⇒ Object (readonly)
Returns the value of attribute ask.
6 7 8 |
# File 'lib/vertpig/summary.rb', line 6 def ask @ask end |
#base_volume ⇒ Object (readonly) Also known as: base_vol
Returns the value of attribute base_volume.
5 6 7 |
# File 'lib/vertpig/summary.rb', line 5 def base_volume @base_volume end |
#bid ⇒ Object (readonly)
Returns the value of attribute bid.
6 7 8 |
# File 'lib/vertpig/summary.rb', line 6 def bid @bid end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
5 6 7 |
# File 'lib/vertpig/summary.rb', line 5 def created_at @created_at end |
#high ⇒ Object (readonly)
Returns the value of attribute high.
5 6 7 |
# File 'lib/vertpig/summary.rb', line 5 def high @high end |
#last ⇒ Object (readonly)
Returns the value of attribute last.
5 6 7 |
# File 'lib/vertpig/summary.rb', line 5 def last @last end |
#low ⇒ Object (readonly)
Returns the value of attribute low.
5 6 7 |
# File 'lib/vertpig/summary.rb', line 5 def low @low end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/vertpig/summary.rb', line 5 def name @name end |
#open_buy_orders ⇒ Object (readonly)
Returns the value of attribute open_buy_orders.
6 7 8 |
# File 'lib/vertpig/summary.rb', line 6 def open_buy_orders @open_buy_orders end |
#open_sell_orders ⇒ Object (readonly)
Returns the value of attribute open_sell_orders.
6 7 8 |
# File 'lib/vertpig/summary.rb', line 6 def open_sell_orders @open_sell_orders end |
#previous_day ⇒ Object (readonly)
Returns the value of attribute previous_day.
6 7 8 |
# File 'lib/vertpig/summary.rb', line 6 def previous_day @previous_day end |
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/vertpig/summary.rb', line 5 def raw @raw end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
6 7 8 |
# File 'lib/vertpig/summary.rb', line 6 def updated_at @updated_at end |
#volume ⇒ Object (readonly) Also known as: vol
Returns the value of attribute volume.
5 6 7 |
# File 'lib/vertpig/summary.rb', line 5 def volume @volume end |
Class Method Details
.all ⇒ Object
28 29 30 |
# File 'lib/vertpig/summary.rb', line 28 def self.all client.get('public/getmarketsummaries').map{|data| new(data) } end |