Class: JIJI::Rate
- Inherits:
-
Object
- Object
- JIJI::Rate
- Includes:
- Dao::TimedData, Util::Model
- Defined in:
- lib/jiji/models.rb
Overview
レート
Instance Attribute Summary collapse
-
#ask ⇒ Object
readonly
Returns the value of attribute ask.
-
#bid ⇒ Object
readonly
Returns the value of attribute bid.
-
#buy_swap ⇒ Object
readonly
Returns the value of attribute buy_swap.
-
#sell_swap ⇒ Object
readonly
Returns the value of attribute sell_swap.
Attributes included from Dao::TimedData
Instance Method Summary collapse
-
#initialize(bid = nil, ask = nil, sell_swap = nil, buy_swap = nil, time = nil) ⇒ Rate
constructor
A new instance of Rate.
-
#values ⇒ Object
値を配列で取得する.
-
#values=(values) ⇒ Object
値を配列で設定する.
Methods included from Util::Model
Constructor Details
#initialize(bid = nil, ask = nil, sell_swap = nil, buy_swap = nil, time = nil) ⇒ Rate
37 38 39 40 41 42 43 |
# File 'lib/jiji/models.rb', line 37 def initialize( bid=nil, ask=nil, sell_swap=nil, buy_swap=nil, time=nil ) @bid = bid @ask = ask @sell_swap = sell_swap @buy_swap = buy_swap @time = time end |
Instance Attribute Details
#ask ⇒ Object (readonly)
Returns the value of attribute ask.
55 56 57 |
# File 'lib/jiji/models.rb', line 55 def ask @ask end |
#bid ⇒ Object (readonly)
Returns the value of attribute bid.
55 56 57 |
# File 'lib/jiji/models.rb', line 55 def bid @bid end |
#buy_swap ⇒ Object (readonly)
Returns the value of attribute buy_swap.
55 56 57 |
# File 'lib/jiji/models.rb', line 55 def buy_swap @buy_swap end |
#sell_swap ⇒ Object (readonly)
Returns the value of attribute sell_swap.
55 56 57 |
# File 'lib/jiji/models.rb', line 55 def sell_swap @sell_swap end |
Instance Method Details
#values ⇒ Object
値を配列で取得する
45 46 47 |
# File 'lib/jiji/models.rb', line 45 def values [bid,ask,sell_swap,buy_swap,time.to_i] end |
#values=(values) ⇒ Object
値を配列で設定する
49 50 51 52 53 54 |
# File 'lib/jiji/models.rb', line 49 def values=(values) @bid = values[0].to_f @ask = values[1].to_f @sell_swap = values[2].to_f @buy_swap = values[3].to_f end |