Class: Archangel::Liquid::Drop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Archangel::Liquid::Drop
- Defined in:
- lib/archangel/liquid/drop.rb
Overview
Liquid Drop for singular resources
Direct Known Subclasses
Archangel::Liquid::Drops::PageDrop, Archangel::Liquid::Drops::SiteDrop
Class Attribute Summary collapse
-
._associations ⇒ Object
Returns the value of attribute _associations.
-
._attributes ⇒ Object
Returns the value of attribute _attributes.
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Class Method Summary collapse
-
.attributes(*attrs) ⇒ Object
Build attributes.
Instance Method Summary collapse
-
#initialize(object, _options = {}) ⇒ Drop
constructor
Initialize.
Constructor Details
#initialize(object, _options = {}) ⇒ Drop
Initialize
42 43 44 |
# File 'lib/archangel/liquid/drop.rb', line 42 def initialize(object, = {}) @object = object end |
Class Attribute Details
._associations ⇒ Object
Returns the value of attribute _associations.
13 14 15 |
# File 'lib/archangel/liquid/drop.rb', line 13 def _associations @_associations end |
._attributes ⇒ Object
Returns the value of attribute _attributes.
14 15 16 |
# File 'lib/archangel/liquid/drop.rb', line 14 def _attributes @_attributes end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
37 38 39 |
# File 'lib/archangel/liquid/drop.rb', line 37 def object @object end |
Class Method Details
.attributes(*attrs) ⇒ Object
Build attributes
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/archangel/liquid/drop.rb', line 25 def self.attributes(*attrs) @_attributes.concat attrs attrs.each do |attr| next if method_defined?(attr) define_method(attr) do object.send(attr) if object.methods.include?(attr) end end end |