Class: LocalizableModel::Configuration

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

Instance Method Summary collapse

Constructor Details

#initialize(attributes = nil) ⇒ Configuration

Returns a new instance of Configuration.



5
6
7
# File 'lib/localizable_model/configuration.rb', line 5

def initialize(attributes = nil)
  @attributes = attributes
end

Instance Method Details

#attribute(attribute_name, options = {}) ⇒ Object



9
10
11
# File 'lib/localizable_model/configuration.rb', line 9

def attribute(attribute_name, options = {})
  attribute_table[attribute_name.to_sym] = options
end

#attribute?(attribute) ⇒ Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/localizable_model/configuration.rb', line 21

def attribute?(attribute)
  attributes.keys.include?(attribute)
end

#attributesObject



13
14
15
# File 'lib/localizable_model/configuration.rb', line 13

def attributes
  attribute_table.merge(dictionary_attributes)
end

#dictionary(dict) ⇒ Object



17
18
19
# File 'lib/localizable_model/configuration.rb', line 17

def dictionary(dict)
  dictionaries << dict
end