Class: Zakuro::Japan::Gengou::Resource::Parser::SwitchDateParser
- Inherits:
-
Object
- Object
- Zakuro::Japan::Gengou::Resource::Parser::SwitchDateParser
- Defined in:
- lib/zakuro/era/japan/gengou/resource/parser.rb
Overview
SwitchDateParser 切替日(運用/計算)
Instance Attribute Summary collapse
-
#calculation ⇒ Hash<String, Strin>
readonly
計算値.
-
#operated ⇒ True, False
readonly
運用値.
-
#operation ⇒ Hash<String, Strin>
readonly
運用値.
Instance Method Summary collapse
-
#create ⇒ Type::Base::SwitchDate
切替日(運用/計算)情報を生成する.
-
#initialize(hash:, operated: false) ⇒ SwitchDateParser
constructor
初期化.
Constructor Details
#initialize(hash:, operated: false) ⇒ SwitchDateParser
初期化
195 196 197 198 199 |
# File 'lib/zakuro/era/japan/gengou/resource/parser.rb', line 195 def initialize(hash:, operated: false) @calculation = hash['calculation'] @operation = hash['operation'] @operated = operated end |
Instance Attribute Details
#calculation ⇒ Hash<String, Strin> (readonly)
Returns 計算値.
183 184 185 |
# File 'lib/zakuro/era/japan/gengou/resource/parser.rb', line 183 def calculation @calculation end |
#operated ⇒ True, False (readonly)
Returns 運用値.
187 188 189 |
# File 'lib/zakuro/era/japan/gengou/resource/parser.rb', line 187 def operated @operated end |
#operation ⇒ Hash<String, Strin> (readonly)
Returns 運用値.
185 186 187 |
# File 'lib/zakuro/era/japan/gengou/resource/parser.rb', line 185 def operation @operation end |
Instance Method Details
#create ⇒ Type::Base::SwitchDate
切替日(運用/計算)情報を生成する
206 207 208 209 210 211 212 213 214 |
# File 'lib/zakuro/era/japan/gengou/resource/parser.rb', line 206 def create calculation_date = Both::DateParser.new(hash: calculation).create operation_date = Both::DateParser.new(hash: operation).create Type::Base::SwitchDate.new( calculation: calculation_date, operation: operation_date, operated: operated ) end |