Class: MetadataPresenter::Page

Inherits:
Metadata
  • Object
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

#id, #initialize, #method_missing, #respond_to_missing?, #to_json, #type

Constructor Details

This class inherits a constructor from MetadataPresenter::Metadata

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class MetadataPresenter::Metadata

Instance Method Details

#==(other) ⇒ Object



9
10
11
# File 'app/models/metadata_presenter/page.rb', line 9

def ==(other)
  id == other.id if other.respond_to? :id
end

#componentsObject



17
18
19
20
21
# File 'app/models/metadata_presenter/page.rb', line 17

def components
  .components&.map do |component|
    MetadataPresenter::Component.new(component)
  end
end

#editable_attributesObject



13
14
15
# File 'app/models/metadata_presenter/page.rb', line 13

def editable_attributes
  self.to_h.reject { |k,_| k.in?([:_id, :_type, :steps]) }
end

#templateObject



27
28
29
# File 'app/models/metadata_presenter/page.rb', line 27

def template
  "metadata_presenter/#{type.gsub('.', '/')}"
end

#to_partial_pathObject



23
24
25
# File 'app/models/metadata_presenter/page.rb', line 23

def to_partial_path
  type.gsub('.', '/')
end

#uuidObject



5
6
7
# File 'app/models/metadata_presenter/page.rb', line 5

def uuid
  _uuid
end