Module: SmoothOperator::Schema
- Included in:
- Base
- Defined in:
- lib/smooth_operator/schema.rb
Instance Method Summary collapse
- #attribute_type(attribute) ⇒ Object
- #internal_structure ⇒ Object
- #known_attribute?(attribute) ⇒ Boolean
- #schema(structure) ⇒ Object
Instance Method Details
#attribute_type(attribute) ⇒ Object
16 17 18 |
# File 'lib/smooth_operator/schema.rb', line 16 def attribute_type(attribute) internal_structure[attribute.to_s] end |
#internal_structure ⇒ Object
8 9 10 |
# File 'lib/smooth_operator/schema.rb', line 8 def internal_structure Helpers.get_instance_variable(self, :internal_structure, {}) end |
#known_attribute?(attribute) ⇒ Boolean
12 13 14 |
# File 'lib/smooth_operator/schema.rb', line 12 def known_attribute?(attribute) internal_structure.has_key?(attribute.to_s) end |
#schema(structure) ⇒ Object
4 5 6 |
# File 'lib/smooth_operator/schema.rb', line 4 def schema(structure) internal_structure.merge! Helpers.stringify_keys(structure) end |