Class: MetadataPresenter::Page
- Inherits:
-
Metadata
show all
- Includes:
- ActiveModel::Validations
- Defined in:
- app/models/metadata_presenter/page.rb
Instance Attribute Summary
Attributes inherited from Metadata
#metadata
Instance Method Summary
collapse
Methods inherited from Metadata
#editor?, #id, #initialize, #method_missing, #respond_to_missing?, #to_json, #type
Instance Method Details
#==(other) ⇒ Object
12
13
14
|
# File 'app/models/metadata_presenter/page.rb', line 12
def ==(other)
id == other.id if other.respond_to? :id
end
|
#components ⇒ Object
20
21
22
23
24
|
# File 'app/models/metadata_presenter/page.rb', line 20
def components
metadata.components&.map do |component|
MetadataPresenter::Component.new(component, editor: editor?)
end
end
|
#content_components ⇒ Object
38
39
40
|
# File 'app/models/metadata_presenter/page.rb', line 38
def content_components
page_components(raw_type)[:content_components]
end
|
#editable_attributes ⇒ Object
16
17
18
|
# File 'app/models/metadata_presenter/page.rb', line 16
def editable_attributes
to_h.reject { |k, _| k.in?(%i[_id _type steps]) }
end
|
34
35
36
|
# File 'app/models/metadata_presenter/page.rb', line 34
def input_components
page_components(raw_type)[:input_components]
end
|
#template ⇒ Object
30
31
32
|
# File 'app/models/metadata_presenter/page.rb', line 30
def template
"metadata_presenter/#{type.gsub('.', '/')}"
end
|
#to_partial_path ⇒ Object
26
27
28
|
# File 'app/models/metadata_presenter/page.rb', line 26
def to_partial_path
type.gsub('.', '/')
end
|
#uuid ⇒ Object
8
9
10
|
# File 'app/models/metadata_presenter/page.rb', line 8
def uuid
_uuid
end
|