Module: MtGox::PriceTicker
- Included in:
- Models::MaxBid, Models::MinAsk, Models::MultiTicker, Models::Ticker
- Defined in:
- lib/mtgox/price_ticker.rb
Instance Attribute Summary collapse
-
#previous_price ⇒ Object
readonly
Returns the value of attribute previous_price.
-
#price ⇒ Object
Returns the value of attribute price.
Instance Method Summary collapse
- #changed? ⇒ Boolean
- #down? ⇒ Boolean
- #unchanged? ⇒ Boolean (also: #unch?)
- #up? ⇒ Boolean
Instance Attribute Details
#previous_price ⇒ Object (readonly)
Returns the value of attribute previous_price.
3 4 5 |
# File 'lib/mtgox/price_ticker.rb', line 3 def previous_price @previous_price end |
#price ⇒ Object
Returns the value of attribute price.
3 4 5 |
# File 'lib/mtgox/price_ticker.rb', line 3 def price @price end |
Instance Method Details
#changed? ⇒ Boolean
18 19 20 |
# File 'lib/mtgox/price_ticker.rb', line 18 def changed? price.to_f != previous_price.to_f end |
#down? ⇒ Boolean
14 15 16 |
# File 'lib/mtgox/price_ticker.rb', line 14 def down? price.to_f < previous_price.to_f end |
#unchanged? ⇒ Boolean Also known as: unch?
22 23 24 |
# File 'lib/mtgox/price_ticker.rb', line 22 def unchanged? !changed? end |
#up? ⇒ Boolean
10 11 12 |
# File 'lib/mtgox/price_ticker.rb', line 10 def up? price.to_f > previous_price.to_f end |