Class: T::Types::OpusEnum
Overview
Validates that an object is equal to another Opus::Enum singleton value.
Instance Attribute Summary collapse
-
#val ⇒ Object
readonly
Returns the value of attribute val.
Instance Method Summary collapse
-
#initialize(val) ⇒ OpusEnum
constructor
A new instance of OpusEnum.
- #name ⇒ Object
- #valid?(obj) ⇒ Boolean
Methods inherited from Base
#==, #describe_obj, #error_message_for_obj, #hash, method_added, #subtype_of?, #to_s, #validate!
Constructor Details
#initialize(val) ⇒ OpusEnum
Returns a new instance of OpusEnum.
9 10 11 |
# File 'lib/types/types/opus_enum.rb', line 9 def initialize(val) @val = val end |
Instance Attribute Details
#val ⇒ Object (readonly)
Returns the value of attribute val.
7 8 9 |
# File 'lib/types/types/opus_enum.rb', line 7 def val @val end |
Instance Method Details
#name ⇒ Object
14 15 16 |
# File 'lib/types/types/opus_enum.rb', line 14 def name @val.inspect end |
#valid?(obj) ⇒ Boolean
19 20 21 |
# File 'lib/types/types/opus_enum.rb', line 19 def valid?(obj) @val == obj end |