Sha256: 0f2098c604ddb3501041705f86170c4dfbfbdbc74920ce3cdc7923f8780d4625

Contents?: true

Size: 470 Bytes

Versions: 9

Compression:

Stored size: 470 Bytes

Contents

require 'liquid_cms/context_association'

module Cms
  class Context
    attr_reader :object

    def initialize(context = nil)
      @object = Cms.context_class ? context : nil
    end

    def pages
      @object ? @object.pages : Cms::Page.scoped(:extend => PageAssociationMethods)
    end

    def assets
      @object ? @object.assets : Cms::Asset.scoped(nil)
    end

    def components
      Cms::Component.files(Cms::Component.full_path(self))
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
liquid_cms-0.3.2.0 lib/liquid_cms/context.rb
liquid_cms-0.2.2.0 lib/liquid_cms/context.rb
liquid_cms-0.2.1.1 lib/liquid_cms/context.rb
liquid_cms-0.3.1.0 lib/liquid_cms/context.rb
liquid_cms-0.2.1.0 lib/liquid_cms/context.rb
liquid_cms-0.2.0.13 lib/liquid_cms/context.rb
liquid_cms-0.3.0.10 lib/liquid_cms/context.rb
liquid_cms-0.3.0.9 lib/liquid_cms/context.rb
liquid_cms-0.2.0.12 lib/liquid_cms/context.rb