Class: KQL::Matcher::Value
- Inherits:
-
KQL::Matcher
- Object
- KQL::Matcher
- KQL::Matcher::Value
- Defined in:
- lib/kql/matcher.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #coerce(a) ⇒ Object
-
#initialize(value) ⇒ Value
constructor
A new instance of Value.
Constructor Details
#initialize(value) ⇒ Value
Returns a new instance of Value.
44 45 46 |
# File 'lib/kql/matcher.rb', line 44 def initialize(value) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
42 43 44 |
# File 'lib/kql/matcher.rb', line 42 def value @value end |
Instance Method Details
#==(other) ⇒ Object
48 49 50 51 52 |
# File 'lib/kql/matcher.rb', line 48 def ==(other) return false unless other.is_a?(Value) other.value == value end |
#coerce(a) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/kql/matcher.rb', line 54 def coerce(a) case a when ::KDL::Value then a.value else a end end |