Class: Asdawqw::Yield
- Defined in:
- lib/asdawqw/models/myield.rb
Overview
Yield Model.
Instance Attribute Summary collapse
-
#amount ⇒ Float
Yield amount.
-
#begin_date ⇒ Date
From date.
-
#end_date ⇒ Date
To date.
-
#modifier ⇒ YieldModifierEnum
Type of change DECREASE_PERCENT, INCREASE_AMOUNT, DECREASE_AMOUNT.
-
#param ⇒ Integer
Parameter.
-
#weekend_param ⇒ WeekendParamEnum
Weekend enum type DAYS_OF_WEEKEND_FRI_SAT, DAYS_OF_WEEKEND_FRI_SAT_SUN, DAYS_OF_WEEKEND_THU_FRI_SAT, DAYS_OF_WEEKEND_THU_FRI_SAT_SUN.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
Instance Method Summary collapse
-
#initialize(begin_date = nil, end_date = nil, amount = nil, modifier = nil, weekend_param = nil, param = nil) ⇒ Yield
constructor
A new instance of Yield.
Methods inherited from BaseModel
Constructor Details
#initialize(begin_date = nil, end_date = nil, amount = nil, modifier = nil, weekend_param = nil, param = nil) ⇒ Yield
Returns a new instance of Yield.
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/asdawqw/models/myield.rb', line 49 def initialize(begin_date = nil, end_date = nil, amount = nil, modifier = nil, weekend_param = nil, param = nil) @begin_date = begin_date @end_date = end_date @amount = amount @modifier = modifier @weekend_param = weekend_param @param = param end |
Instance Attribute Details
#amount ⇒ Float
Yield amount
19 20 21 |
# File 'lib/asdawqw/models/myield.rb', line 19 def amount @amount end |
#begin_date ⇒ Date
From date. Date should be in format “yyyy-MM-dd”
11 12 13 |
# File 'lib/asdawqw/models/myield.rb', line 11 def begin_date @begin_date end |
#end_date ⇒ Date
To date. Date should be in format “yyyy-MM-dd”
15 16 17 |
# File 'lib/asdawqw/models/myield.rb', line 15 def end_date @end_date end |
#modifier ⇒ YieldModifierEnum
Type of change DECREASE_PERCENT, INCREASE_AMOUNT, DECREASE_AMOUNT
24 25 26 |
# File 'lib/asdawqw/models/myield.rb', line 24 def modifier @modifier end |
#param ⇒ Integer
Parameter. It can verify depending on what YMR was set. More details about params you can see in the description above.
35 36 37 |
# File 'lib/asdawqw/models/myield.rb', line 35 def param @param end |
#weekend_param ⇒ WeekendParamEnum
Weekend enum type DAYS_OF_WEEKEND_FRI_SAT, DAYS_OF_WEEKEND_FRI_SAT_SUN, DAYS_OF_WEEKEND_THU_FRI_SAT, DAYS_OF_WEEKEND_THU_FRI_SAT_SUN
30 31 32 |
# File 'lib/asdawqw/models/myield.rb', line 30 def weekend_param @weekend_param end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/asdawqw/models/myield.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. begin_date = hash['beginDate'] end_date = hash['endDate'] amount = hash['amount'] modifier = hash['modifier'] weekend_param = hash['weekendParam'] param = hash['param'] # Create object from extracted values. Yield.new(begin_date, end_date, amount, modifier, weekend_param, param) end |
.names ⇒ Object
A mapping from model property names to API property names.
38 39 40 41 42 43 44 45 46 47 |
# File 'lib/asdawqw/models/myield.rb', line 38 def self.names @_hash = {} if @_hash.nil? @_hash['begin_date'] = 'beginDate' @_hash['end_date'] = 'endDate' @_hash['amount'] = 'amount' @_hash['modifier'] = 'modifier' @_hash['weekend_param'] = 'weekendParam' @_hash['param'] = 'param' @_hash end |