Class: NRSER::Types::Is
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #default_name ⇒ Object
-
#initialize(value, **options) ⇒ Is
constructor
A new instance of Is.
- #test(value) ⇒ Object
Methods inherited from Type
#check, #from_data, #from_s, #has_from_data?, #has_from_s?, #has_to_data?, #name, #respond_to?, short_name, #to_data, #to_s
Constructor Details
#initialize(value, **options) ⇒ Is
Returns a new instance of Is.
9 10 11 12 13 |
# File 'lib/nrser/types/is.rb', line 9 def initialize value, ** super ** @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/nrser/types/is.rb', line 7 def value @value end |
Instance Method Details
#==(other) ⇒ Object
23 24 25 |
# File 'lib/nrser/types/is.rb', line 23 def == other equal?(other) || @value === other.value end |
#default_name ⇒ Object
15 16 17 |
# File 'lib/nrser/types/is.rb', line 15 def default_name "Is(#{ @value.inspect })" end |
#test(value) ⇒ Object
19 20 21 |
# File 'lib/nrser/types/is.rb', line 19 def test value @value.equal? value end |