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
askレート.
-
#bid ⇒ Object
readonly
bidレート.
-
#buy_swap ⇒ Object
readonly
買いスワップ.
-
#sell_swap ⇒ Object
readonly
売りスワップ.
Attributes included from Dao::TimedData
Instance Method Summary collapse
-
#initialize(bid = nil, ask = nil, sell_swap = nil, buy_swap = nil, time = nil) ⇒ Rate
constructor
:nodoc:.
-
#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
:nodoc:
44 45 46 47 48 49 50 |
# File 'lib/jiji/models.rb', line 44 def initialize( bid=nil, ask=nil, sell_swap=nil, buy_swap=nil, time=nil ) #:nodoc: @bid = bid @ask = ask @sell_swap = sell_swap @buy_swap = buy_swap @time = time end |
Instance Attribute Details
#ask ⇒ Object (readonly)
askレート
65 66 67 |
# File 'lib/jiji/models.rb', line 65 def ask @ask end |
#bid ⇒ Object (readonly)
bidレート
63 64 65 |
# File 'lib/jiji/models.rb', line 63 def bid @bid end |
#buy_swap ⇒ Object (readonly)
買いスワップ
69 70 71 |
# File 'lib/jiji/models.rb', line 69 def buy_swap @buy_swap end |
#sell_swap ⇒ Object (readonly)
売りスワップ
67 68 69 |
# File 'lib/jiji/models.rb', line 67 def sell_swap @sell_swap end |
Instance Method Details
#values ⇒ Object
値を配列で取得する
52 53 54 |
# File 'lib/jiji/models.rb', line 52 def values #:nodoc: [bid,ask,sell_swap,buy_swap,time.to_i] end |
#values=(values) ⇒ Object
値を配列で設定する
56 57 58 59 60 61 |
# File 'lib/jiji/models.rb', line 56 def values=(values) #:nodoc: @bid = values[0].to_f @ask = values[1].to_f @sell_swap = values[2].to_f @buy_swap = values[3].to_f end |