Class: StoreSchema::Converter::String

Inherits:
Base
  • Object
show all
Defined in:
lib/store_schema/converter/string.rb

Instance Attribute Summary

Attributes inherited from Base

#value

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from StoreSchema::Converter::Base

Instance Method Details

#from_dbString

Simply returns Base#value since it's already a String-type.

Returns:


21
22
23
# File 'lib/store_schema/converter/string.rb', line 21

def from_db
  value
end

#to_dbString, false

Simply returns Base#value if it's a String.

Returns:


9
10
11
12
13
14
15
# File 'lib/store_schema/converter/string.rb', line 9

def to_db
  if value.is_a?(::String)
    value
  else
    false
  end
end