Module: ArDocStore

Defined in:
lib/ar_doc_store.rb,
lib/ar_doc_store/model.rb,
lib/ar_doc_store/storage.rb,
lib/ar_doc_store/version.rb,
lib/ar_doc_store/embedding.rb,
lib/ar_doc_store/embeddable_model.rb,
lib/ar_doc_store/attribute_types/base_attribute.rb,
lib/ar_doc_store/attribute_types/uuid_attribute.rb,
lib/ar_doc_store/attribute_types/array_attribute.rb,
lib/ar_doc_store/attribute_types/float_attribute.rb,
lib/ar_doc_store/attribute_types/string_attribute.rb,
lib/ar_doc_store/attribute_types/boolean_attribute.rb,
lib/ar_doc_store/attribute_types/integer_attribute.rb,
lib/ar_doc_store/attribute_types/embeds_one_attribute.rb,
lib/ar_doc_store/attribute_types/embeds_many_attribute.rb,
lib/ar_doc_store/attribute_types/enumeration_attribute.rb

Defined Under Namespace

Modules: AttributeTypes, EmbeddableModel, Embedding, Model, Storage Classes: EmbeddedCollection

Constant Summary collapse

VERSION =
"0.2.1"

Class Method Summary collapse

Class Method Details

.convert_boolean(bool) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/ar_doc_store.rb', line 35

def self.convert_boolean(bool)
  if bool.is_a?(String)
    return true if bool == true || bool =~ (/^(true|t|yes|y|1)$/i)
    return false if bool == false || bool.blank? || bool =~ (/^(false|f|no|n|0)$/i)
  elsif bool.is_a?(Integer)
    return bool > 0
  elsif bool.is_a?(TrueClass)
    return true
  elsif bool.is_a?(FalseClass)
    return false
  else
    return nil
  end
end

.mappingsObject



31
32
33
# File 'lib/ar_doc_store.rb', line 31

def self.mappings
  @mappings
end