Class: Iron::ContentType
Defined Under Namespace
Modules: Exportable, FieldQueryable, Importable, Titlable, WebPublishable
Constant Summary
collapse
- TYPES =
%w[Single Collection].freeze
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Titlable
#titlable_definitions
#index_entry, #path_for
Methods included from Exportable
#export_attributes
Class Method Details
.classify_type(type) ⇒ Object
23
24
25
|
# File 'app/models/iron/content_type.rb', line 23
def classify_type(type)
"Iron::ContentTypes::#{type}"
end
|
.inherited(subclass) ⇒ Object
27
28
29
30
31
32
|
# File 'app/models/iron/content_type.rb', line 27
def inherited(subclass)
super
def subclass.model_name
superclass.model_name
end
end
|
Instance Method Details
#collection? ⇒ Boolean
43
44
45
|
# File 'app/models/iron/content_type.rb', line 43
def collection?
is_a?(ContentTypes::Collection)
end
|
#humanized_type ⇒ Object
35
36
37
|
# File 'app/models/iron/content_type.rb', line 35
def humanized_type
type.demodulize
end
|
#single? ⇒ Boolean
39
40
41
|
# File 'app/models/iron/content_type.rb', line 39
def single?
is_a?(ContentTypes::Single)
end
|