Class: Json::Merge::ThreeWayDecision::State
- Inherits:
-
Data
- Object
- Data
- Json::Merge::ThreeWayDecision::State
- Defined in:
- lib/json/merge/three_way_decision.rb,
sig/json/merge.rbs
Instance Attribute Summary collapse
-
#present ⇒ Object
readonly
Returns the value of attribute present.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#present ⇒ Object (readonly)
Returns the value of attribute present
8 9 10 |
# File 'lib/json/merge/three_way_decision.rb', line 8 def present @present end |
#value ⇒ Object (readonly)
Returns the value of attribute value
8 9 10 |
# File 'lib/json/merge/three_way_decision.rb', line 8 def value @value end |
Class Method Details
.missing ⇒ State
13 14 15 |
# File 'lib/json/merge/three_way_decision.rb', line 13 def self.missing @missing ||= new(present: false, value: nil) end |
.present(value) ⇒ State
9 10 11 |
# File 'lib/json/merge/three_way_decision.rb', line 9 def self.present(value) new(present: true, value: value) end |
Instance Method Details
#to_h ⇒ Hash[Symbol, untyped]
17 18 19 |
# File 'lib/json/merge/three_way_decision.rb', line 17 def to_h present ? { present: true, value: value } : { present: false } end |