Class: Zakuro::Japan::Type::Base::SwitchDate
- Inherits:
-
Object
- Object
- Zakuro::Japan::Type::Base::SwitchDate
- Defined in:
- lib/zakuro/era/japan/type/base/switch_date.rb
Overview
SwitchDate 切替日(運用/計算)
Instance Attribute Summary collapse
-
#calculation ⇒ Both::Date
readonly
計算値.
-
#japan ⇒ Japan::Calendar
readonly
和暦日.
-
#operated ⇒ True, False
readonly
運用値.
-
#operation ⇒ Both::Date
readonly
運用値.
-
#western ⇒ Western::Calendar
readonly
西暦日.
Instance Method Summary collapse
-
#initialize(calculation: Both::Date.new, operation: Both::Date.new, operated: false) ⇒ SwitchDate
constructor
初期化.
-
#invalid? ⇒ True, False
不正か.
Constructor Details
#initialize(calculation: Both::Date.new, operation: Both::Date.new, operated: false) ⇒ SwitchDate
初期化
38 39 40 41 42 43 44 |
# File 'lib/zakuro/era/japan/type/base/switch_date.rb', line 38 def initialize(calculation: Both::Date.new, operation: Both::Date.new, operated: false) @calculation = calculation @operation = operation @operated = operated select end |
Instance Attribute Details
#calculation ⇒ Both::Date (readonly)
Returns 計算値.
21 22 23 |
# File 'lib/zakuro/era/japan/type/base/switch_date.rb', line 21 def calculation @calculation end |
#japan ⇒ Japan::Calendar (readonly)
Returns 和暦日.
27 28 29 |
# File 'lib/zakuro/era/japan/type/base/switch_date.rb', line 27 def japan @japan end |
#operated ⇒ True, False (readonly)
Returns 運用値.
25 26 27 |
# File 'lib/zakuro/era/japan/type/base/switch_date.rb', line 25 def operated @operated end |
#operation ⇒ Both::Date (readonly)
Returns 運用値.
23 24 25 |
# File 'lib/zakuro/era/japan/type/base/switch_date.rb', line 23 def operation @operation end |
#western ⇒ Western::Calendar (readonly)
Returns 西暦日.
29 30 31 |
# File 'lib/zakuro/era/japan/type/base/switch_date.rb', line 29 def western @western end |
Instance Method Details
#invalid? ⇒ True, False
不正か
52 53 54 |
# File 'lib/zakuro/era/japan/type/base/switch_date.rb', line 52 def invalid? japan.invalid? || western.invalid? end |