Class: Settingify::Reader

Inherits:
Struct
  • Object
show all
Defined in:
lib/settingify/reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#defaultObject

Returns the value of attribute default

Returns:

  • (Object)

    the current value of default



2
3
4
# File 'lib/settingify/reader.rb', line 2

def default
  @default
end

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



2
3
4
# File 'lib/settingify/reader.rb', line 2

def key
  @key
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



2
3
4
# File 'lib/settingify/reader.rb', line 2

def type
  @type
end

Instance Method Details

#callObject



3
4
5
6
# File 'lib/settingify/reader.rb', line 3

def call
  return default unless table_exists?
  Caster.new(type, db_value).call
end