Module: MtGox::PriceTicker
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.
5 6 7 |
# File 'lib/mtgox/price_ticker.rb', line 5 def previous_price @previous_price end |
#price ⇒ Object
Returns the value of attribute price.
5 6 7 |
# File 'lib/mtgox/price_ticker.rb', line 5 def price @price end |
Instance Method Details
#changed? ⇒ Boolean
20 21 22 |
# File 'lib/mtgox/price_ticker.rb', line 20 def changed? BigDecimal(price.to_s) != BigDecimal(previous_price.to_s) end |
#down? ⇒ Boolean
16 17 18 |
# File 'lib/mtgox/price_ticker.rb', line 16 def down? BigDecimal(price.to_s) < BigDecimal(previous_price.to_s) end |
#unchanged? ⇒ Boolean Also known as: unch?
24 25 26 |
# File 'lib/mtgox/price_ticker.rb', line 24 def unchanged? !changed? end |
#up? ⇒ Boolean
12 13 14 |
# File 'lib/mtgox/price_ticker.rb', line 12 def up? BigDecimal(price.to_s) > BigDecimal(previous_price.to_s) end |