Class: SimpleEnumeration::CollectionMethodsDefiner
- Inherits:
-
Object
- Object
- SimpleEnumeration::CollectionMethodsDefiner
- Defined in:
- lib/simple_enumeration/collection_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.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(enum_class:, collection:) ⇒ CollectionMethodsDefiner
constructor
A new instance of CollectionMethodsDefiner.
Constructor Details
#initialize(enum_class:, collection:) ⇒ CollectionMethodsDefiner
Returns a new instance of CollectionMethodsDefiner.
7 8 9 10 |
# File 'lib/simple_enumeration/collection_methods_definer.rb', line 7 def initialize(enum_class:, collection:) @enum_class = enum_class @collection = collection end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
5 6 7 |
# File 'lib/simple_enumeration/collection_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/collection_methods_definer.rb', line 5 def enum_class @enum_class end |
Class Method Details
.call(*params, **options, &block) ⇒ Object
12 13 14 |
# File 'lib/simple_enumeration/collection_methods_definer.rb', line 12 def self.call(*params, **, &block) new(*params, **).call(&block) end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 24 |
# File 'lib/simple_enumeration/collection_methods_definer.rb', line 16 def call set_collection define_singleton_collection define_singleton_collection_values_method define_singleton_collection_value_predicate_method define_singleton_collection_for_select_method define_singleton_collection_humanized_method define_instance_collection_value_predicate_method end |