Class: Material::Base

Inherits:
Spicerack::AttributeObject
  • Object
show all
Includes:
Components, Core, Display, For, Format, Site, Text
Defined in:
lib/material/base.rb

Constant Summary

Constants included from Text

Text::DEFAULT_TRUNCATE_LENGTH

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Core

#initialize

Class Method Details

.for(object) ⇒ Object



15
16
17
18
# File 'lib/material/base.rb', line 15

def self.for(object)
  material_class = material_class_for(object, "Material")
  material_class.new(object) if material_class.present?
end

Instance Method Details

#to_model ⇒ Object



24
25
26
# File 'lib/material/base.rb', line 24

def to_model
  self
end

#to_source_model ⇒ Object



20
21
22
# File 'lib/material/base.rb', line 20

def to_source_model
  source.to_model
end