Class: Locomotive::ContentTypeService
- Inherits:
-
Struct
- Object
- Struct
- Locomotive::ContentTypeService
- Defined in:
- app/services/locomotive/content_type_service.rb
Instance Attribute Summary collapse
-
#site ⇒ Object
Returns the value of attribute site.
Instance Method Summary collapse
Instance Attribute Details
#site ⇒ Object
Returns the value of attribute site
2 3 4 |
# File 'app/services/locomotive/content_type_service.rb', line 2 def site @site end |
Instance Method Details
#find_by_slug(slug) ⇒ Object
10 11 12 |
# File 'app/services/locomotive/content_type_service.rb', line 10 def find_by_slug(slug) site.content_types.by_id_or_slug(slug) end |
#list ⇒ Object
4 5 6 7 8 |
# File 'app/services/locomotive/content_type_service.rb', line 4 def list site.content_types .only(:_id, :name, :slug, :number_of_entries, :display_settings) .order_by(:'display_settings.position'.asc, :name.asc).to_a end |
#update(content_type, attributes = {}) ⇒ Object
14 15 16 |
# File 'app/services/locomotive/content_type_service.rb', line 14 def update(content_type, attributes = {}) content_type.update_attributes(attributes) end |