Class: NRSER::Types::Is

Inherits:
Type
  • Object
show all
Defined in:
lib/nrser/types/is.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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



9
10
11
12
13
# File 'lib/nrser/types/is.rb', line 9

def initialize value, **options
  super **options
  
  @value = value
end

Instance Attribute Details

#valueObject (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_nameObject



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