Class: SimpleEnumeration::TypeMethodsDefiner
- Inherits:
-
Object
- Object
- SimpleEnumeration::TypeMethodsDefiner
- Defined in:
- lib/simple_enumeration/type_methods_definer.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#enum_class ⇒ Object
readonly
Returns the value of attribute enum_class.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(enum_class:, collection:, type:) ⇒ TypeMethodsDefiner
constructor
A new instance of TypeMethodsDefiner.
Constructor Details
#initialize(enum_class:, collection:, type:) ⇒ TypeMethodsDefiner
Returns a new instance of TypeMethodsDefiner.
7 8 9 10 11 |
# File 'lib/simple_enumeration/type_methods_definer.rb', line 7 def initialize(enum_class:, collection:, type:) @enum_class = enum_class @collection = collection @type = type end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
5 6 7 |
# File 'lib/simple_enumeration/type_methods_definer.rb', line 5 def collection @collection end |
#enum_class ⇒ Object (readonly)
Returns the value of attribute enum_class.
5 6 7 |
# File 'lib/simple_enumeration/type_methods_definer.rb', line 5 def enum_class @enum_class end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/simple_enumeration/type_methods_definer.rb', line 5 def type @type end |
Class Method Details
.call(*params, **options, &block) ⇒ Object
13 14 15 |
# File 'lib/simple_enumeration/type_methods_definer.rb', line 13 def self.call(*params, **, &block) new(*params, **).call(&block) end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 |
# File 'lib/simple_enumeration/type_methods_definer.rb', line 17 def call define_singleton_type_method define_singleton_type_value_method define_singleton_type_value_predicate_method define_instance_type_value_predicate_method end |