Class: EntitySchema::Fields::Specifications::Abstract
- Inherits:
-
Object
- Object
- EntitySchema::Fields::Specifications::Abstract
- Defined in:
- lib/entity_schema/fields/specifications/abstract.rb
Overview
Transform raw valid options to usefull options
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(name, owner_name, raw_options) ⇒ Abstract
constructor
A new instance of Abstract.
- #method_missing(key, *_args, **_opts) ⇒ Object
- #respond_to_missing?(key) ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(name, owner_name, raw_options) ⇒ Abstract
Returns a new instance of Abstract.
8 9 10 11 12 |
# File 'lib/entity_schema/fields/specifications/abstract.rb', line 8 def initialize(name, owner_name, ) @options = (name: name, owner_name: owner_name, **) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Method Details
#[](key) ⇒ Object
14 15 16 |
# File 'lib/entity_schema/fields/specifications/abstract.rb', line 14 def [](key) .fetch(key, nil) end |
#respond_to_missing?(key) ⇒ Boolean
29 30 31 |
# File 'lib/entity_schema/fields/specifications/abstract.rb', line 29 def respond_to_missing?(key) .key?(key) || bool_key?(without_predicate(key)) end |
#to_h ⇒ Object
18 19 20 |
# File 'lib/entity_schema/fields/specifications/abstract.rb', line 18 def to_h .dup end |