Class: Bitfinex::Models::FundingInfo

Inherits:
Model
  • Object
show all
Defined in:
lib/models/funding_info.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#apply

Constructor Details

#initialize(data) ⇒ FundingInfo

Returns a new instance of FundingInfo.



9
10
11
# File 'lib/models/funding_info.rb', line 9

def initialize (data)
  super(data, {}, [])
end

Instance Attribute Details

#duration_lendObject

Returns the value of attribute duration_lend.



7
8
9
# File 'lib/models/funding_info.rb', line 7

def duration_lend
  @duration_lend
end

#duration_loanObject

Returns the value of attribute duration_loan.



7
8
9
# File 'lib/models/funding_info.rb', line 7

def duration_loan
  @duration_loan
end

#symbolObject

Returns the value of attribute symbol.



6
7
8
# File 'lib/models/funding_info.rb', line 6

def symbol
  @symbol
end

#yield_lendObject

Returns the value of attribute yield_lend.



6
7
8
# File 'lib/models/funding_info.rb', line 6

def yield_lend
  @yield_lend
end

#yield_loanObject

Returns the value of attribute yield_loan.



6
7
8
# File 'lib/models/funding_info.rb', line 6

def yield_loan
  @yield_loan
end

Class Method Details

.unserialize(arr) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/models/funding_info.rb', line 26

def self.unserialize (arr)
  symbol = arr[1]
  data = arr[2]

  {
    :symbol => symbol,
    :yield_loan => data[0],
    :yield_lend => data[1],
    :duration_loan => data[2],
    :duration_lend => data[3]
  }
end

Instance Method Details

#serializeObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/models/funding_info.rb', line 13

def serialize ()
  [
    'sym',
    self.symbol,
    [
      self.yield_loan,
      self.yield_lend,
      self.duration_loan,
      self.duration_lend
    ]
  ]
end