Class: ActiveColumn::KeyConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, options) ⇒ KeyConfig

Returns a new instance of KeyConfig.



6
7
8
9
# File 'lib/active_column/key_config.rb', line 6

def initialize(key, options)
  @key = key
  @func = options[:values] || key
end

Instance Attribute Details

#funcObject

Returns the value of attribute func.



4
5
6
# File 'lib/active_column/key_config.rb', line 4

def func
  @func
end

#keyObject

Returns the value of attribute key.



4
5
6
# File 'lib/active_column/key_config.rb', line 4

def key
  @key
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/active_column/key_config.rb', line 11

def to_s
  "KeyConfig[#{key}, #{func or '-'}]"
end