Module: Inverter::Object
- Included in:
- Inverter
- Defined in:
- lib/inverter/object.rb
Instance Attribute Summary collapse
-
#meta_tags ⇒ Object
Returns the value of attribute meta_tags.
-
#object ⇒ Object
Returns the value of attribute object.
Instance Method Summary collapse
- #reset_object ⇒ Object
- #set_meta_tags(meta_tags_collection) ⇒ Object
- #update_inverter_object(template_name) ⇒ Object
Instance Attribute Details
#meta_tags ⇒ Object
Returns the value of attribute meta_tags.
4 5 6 |
# File 'lib/inverter/object.rb', line 4 def @meta_tags end |
#object ⇒ Object
Returns the value of attribute object.
4 5 6 |
# File 'lib/inverter/object.rb', line 4 def object @object end |
Instance Method Details
#reset_object ⇒ Object
30 31 32 |
# File 'lib/inverter/object.rb', line 30 def reset_object self.object = nil end |
#set_meta_tags(meta_tags_collection) ⇒ Object
35 36 37 |
# File 'lib/inverter/object.rb', line 35 def () self. = end |
#update_inverter_object(template_name) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/inverter/object.rb', line 10 def update_inverter_object(template_name) # proceed if inverter object is not set if Inverter.object.nil? # template is in inverter template folders if template_name.start_with?(*Inverter.template_folders) # template is not excluded via configuration template = template_name.gsub('.html.erb', '') if not Inverter.excluded_templates.include?(template) self.object = Inverter.model_class.where(_template_name: template_name).first return self.object end end end return nil end |