class Locomotive::Steam::Page

Attributes

_fullpath[RW]
content_entry[RW]
depth[RW]

Public Class Methods

new(attributes) click to toggle source
Calls superclass method Locomotive::Steam::Models::Entity::new
# File lib/locomotive/steam/entities/page.rb, line 9
def initialize(attributes)
  super({
    handle:                     nil,
    listed:                     false,
    published:                  true,
    templatized:                false,
    cache_enabled:              true,
    fullpath:                   {},
    response_type:              nil,
    content_type:               nil,
    target_klass_name:          nil,
    position:                   99,
    raw_template:               nil,
    source:                     nil,
    editable_elements:          {},
    sections_content:           {},
    sections_dropzone_content:  [],
    redirect:                   nil,
    redirect_url:               {},
    redirect_type:              nil,
    parent_id:                  nil,
    parent_ids:                 nil,
    updated_at:                 Time.zone.now
  }.merge(attributes))
end

Public Instance Methods

content_type_id() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 40
def content_type_id
  self.target_klass_name =~ Locomotive::Steam::CONTENT_ENTRY_ENGINE_CLASS_NAME
  $1 || self.target_klass_name
end
index?() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 45
def index?
  attributes[:fullpath].values.first == 'index'
end
layout?() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 53
def layout?
  (attributes[:fullpath].values.first =~ Locomotive::Steam::IsLAYOUT) == 0
end
listed?() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 35
def listed?; !!listed; end
not_found?() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 49
def not_found?
  attributes[:fullpath].values.first == '404'
end
published?() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 36
def published?; !!published; end
redirect?() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 38
def redirect?; redirect.nil? ? !redirect_url.blank? : redirect; end
source() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 57
def source
  self[:raw_template]
end
templatized?() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 37
def templatized?; !!templatized; end
to_liquid() click to toggle source
# File lib/locomotive/steam/entities/page.rb, line 65
def to_liquid
  Locomotive::Steam::Liquid::Drops::Page.new(self)
end