Module: ConfigManager::Settings::Values::ClassMethods

Defined in:
lib/config_manager/settings/values.rb

Instance Method Summary collapse

Instance Method Details

#date_value(id) ⇒ Object



13
14
15
16
17
# File 'lib/config_manager/settings/values.rb', line 13

def date_value(id)
	value(id).to_date
rescue NoMethodError
	nil
end

#integer_value(id) ⇒ Object



25
26
27
28
29
# File 'lib/config_manager/settings/values.rb', line 25

def integer_value(id)
	value(id).to_i
rescue NoMethodError
	nil
end

#number_value(id) ⇒ Object



31
32
33
34
35
# File 'lib/config_manager/settings/values.rb', line 31

def number_value(id)
	value(id).to_f
rescue NoMethodError
	nil
end

#time_value(id) ⇒ Object



19
20
21
22
23
# File 'lib/config_manager/settings/values.rb', line 19

def time_value(id)
	value(id).to_time
rescue NoMethodError
	nil
end

#value(id) ⇒ Object



9
10
11
# File 'lib/config_manager/settings/values.rb', line 9

def value(id)
	(find(id) || build({})).value
end