Module: Rack::Less::Options::ClassMethods

Defined in:
lib/rack/less/options.rb

Instance Method Summary collapse

Instance Method Details

#defaultsObject



26
27
28
29
30
31
32
33
# File 'lib/rack/less/options.rb', line 26

def defaults
  {
    option_name(:root)      => ".",
    option_name(:source)    => 'app/stylesheets',
    option_name(:public)    => 'public',
    option_name(:hosted_at) => '/stylesheets'
  }
end

#option_name(key) ⇒ Object

Rack::Less uses the Rack Environment to store option values. All options are stored in the Rack Environment as “<RACK_ENV_PREFIX>.<option>”, where <option> is the option name.



38
39
40
41
42
43
44
# File 'lib/rack/less/options.rb', line 38

def option_name(key)
  case key
  when Symbol ; "#{RACK_ENV_NS}.#{key}"
  when String ; key
  else raise ArgumentError
  end
end