Class: Machined::Context

Inherits:
Sprockets::Context
  • Object
show all
Includes:
Helpers::AssetTagHelpers, Helpers::LocalsHelpers, Helpers::OutputHelpers, Helpers::PageHelpers, Helpers::RenderHelpers, Padrino::Helpers::AssetTagHelpers, Padrino::Helpers::FormHelpers, Padrino::Helpers::FormatHelpers, Padrino::Helpers::NumberHelpers, Padrino::Helpers::OutputHelpers, Padrino::Helpers::TagHelpers, Padrino::Helpers::TranslationHelpers
Defined in:
lib/machined/context.rb

Constant Summary

Constants included from Helpers::OutputHelpers

Helpers::OutputHelpers::CAPTURE_ENGINES

Instance Method Summary collapse

Methods included from Helpers::RenderHelpers

#render, #render_collection, #render_partial

Methods included from Helpers::PageHelpers

#context_for, #layout, #title, #url

Methods included from Helpers::LocalsHelpers

#has_local?, #locals, #locals=, #method_missing, #respond_to?, #with_locals

Methods included from Helpers::AssetTagHelpers

#asset_path

Constructor Details

#initialize(*args) ⇒ Context

Override initialize to add helpers from the Machined environment.



23
24
25
26
# File 'lib/machined/context.rb', line 23

def initialize(*args) # :nodoc:
  super
  add_machined_helpers
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Machined::Helpers::LocalsHelpers

Instance Method Details

#configObject

Returns the configuration of the Machined environment.



34
35
36
# File 'lib/machined/context.rb', line 34

def config
  machined.config
end

#machinedObject

Returns the main Machined environment instance.



29
30
31
# File 'lib/machined/context.rb', line 29

def machined
  environment.machined
end