Class: Crystal::OptionsForController

Inherits:
Object
  • Object
show all
Defined in:
lib/crystal/options_for_controller.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller) ⇒ OptionsForController

Returns a new instance of OptionsForController.



5
6
7
# File 'lib/crystal/options_for_controller.rb', line 5

def initialize(controller)
  @controller = controller
end

Instance Attribute Details

#controllerObject (readonly)

Returns the value of attribute controller.



3
4
5
# File 'lib/crystal/options_for_controller.rb', line 3

def controller
  @controller
end

Instance Method Details

#optionsObject



9
10
11
# File 'lib/crystal/options_for_controller.rb', line 9

def options
  paths.inject(default_options){|memo, path| memo.deep_merge!(I18n.t(path, :scope => scope, :default => {}))}
end