Module: Isomorphic::Lens::Internal::InstanceMethodsForLens
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/isomorphic/lens.rb
Overview
Included when the base class has a #factory
and #inflector
, and hence, can build Isomorphic lenses.
Instance Method Summary collapse
-
#reflect_on_association(association) ⇒ Isomorphic::Lens::Association
Build a lens for the Active Record association with the given name.
-
#reflect_on_attribute(attribute_name, to = nil, from = nil) ⇒ Isomorphic::Lens::Attribute
Build a lens for the attribute with the given name.
-
#reflect_on_isomorphism(terms, *args) ⇒ Isomorphic::Lens::Isomorphism
Build a lens for the given inflectable terms and optional arguments.
Instance Method Details
#reflect_on_association(association) ⇒ Isomorphic::Lens::Association
Build a lens for the Active Record association with the given name.
41 42 43 |
# File 'lib/isomorphic/lens.rb', line 41 def reflect_on_association(association) Isomorphic::Lens::Association.new(factory, inflector, association, nil) end |
#reflect_on_attribute(attribute_name, to = nil, from = nil) ⇒ Isomorphic::Lens::Attribute
Build a lens for the attribute with the given name.
51 52 53 |
# File 'lib/isomorphic/lens.rb', line 51 def reflect_on_attribute(attribute_name, to = nil, from = nil) Isomorphic::Lens::Attribute.new(factory, inflector, attribute_name, to, from) end |
#reflect_on_isomorphism(terms, *args) ⇒ Isomorphic::Lens::Isomorphism
Build a lens for the given inflectable terms and optional arguments.
61 62 63 |
# File 'lib/isomorphic/lens.rb', line 61 def reflect_on_isomorphism(terms, *args) Isomorphic::Lens::Isomorphism.new(factory, inflector, terms, *args) end |