Class: SuperList

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

Defined Under Namespace

Classes: Data, List

Constant Summary collapse

@@options =
{ :use_i18n => false}
@@data =
ActiveSupport::OrderedHash.new

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, values, options = {}) ⇒ SuperList

Returns a new instance of SuperList.



12
13
14
15
16
# File 'lib/super_list.rb', line 12

def initialize(name, values, options={})
  # { :use_i18n => false, :i18n_scope => 'super_list'}
  options = @@options.merge(:i18n_scope => name).merge(options)
  @@data[name] = Data.new(values, options)
end

Class Method Details

.[](name) ⇒ Object



18
19
20
# File 'lib/super_list.rb', line 18

def self.[](name)
  @@data[name]
end

.default_option=(options) ⇒ Object



8
9
10
# File 'lib/super_list.rb', line 8

def self.default_option=(options)
  @@options.update(options)
end