Class: Dolly::Document

Constant Summary

Constants included from Mango

Mango::ALL_OPERATORS, Mango::COMBINATION_OPERATORS, Mango::CONDITION_OPERATORS, Mango::DESIGN, Mango::SELECTOR_SYMBOL, Mango::TYPE_OPERATOR

Constants included from Properties

Properties::SPECIAL_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Mango

docs_where, find_bare, find_by, find_doc_by, find_with_metadata, perform_query, where, where_bare, where_with_metadata

Methods included from Query

all, build_collection, bulk_document, bulk_find, find, find_all, find_with, first, last, safe_find

Methods included from DocumentType

#base_id, #class_name, included, #name_paramitized, #namespace_key, #namespace_keys, #partitioned?, #set_type, #type_sep, #typed?

Methods included from QueryArguments

#default_query_args, #descending_query_args, #escape_value, #escape_values, #last_item_in_range

Methods included from ViewQuery

collection_view, raw_view, view_value

Methods included from Request

app_env, connection, namespace, set_app_env, set_namespace

Methods included from DepracatedDatabase

database, view

Methods included from Properties

all_property_keys, properties, property, property_clean_doc, property_keys, silence_redefinition_of_method

Methods included from DocumentCreation

create, from_doc, from_json

Methods included from FrameworkHelper

#rails?

Methods included from ClassMethodsDelegation

#connection, #database, #property_clean_doc

Methods included from Attachment

#attach_file, #attach_file!, #attach_inline_file, #attach_standalone_file

Methods included from IdentityProperties

#id, #id=, #id_as_resource, #rev, #rev=

Methods included from DocumentState

#after_save, #destroy, #persisted?, #reload, #save, #save!, #to_h, #update_properties, #update_properties!, #valid?

Methods included from Timestamp

included, #timestamped?, #write_timestamps

Methods included from PropertyManager

#assign_identity_properties, #assign_rev_properties, #build_property, #properties, #set_property_value, #update_attribute, #update_doc, #valid_property?, #write_attribute

Constructor Details

#initialize(attributes = {}) ⇒ Document

Returns a new instance of Document.



45
46
47
48
# File 'lib/dolly/document.rb', line 45

def initialize(attributes = {})
  @doc = doc_for_framework
  properties.each(&build_property(attributes))
end

Instance Attribute Details

#doc=(value) ⇒ Object

Sets the attribute doc

Parameters:

  • value

    the value to set the attribute doc to.



43
44
45
# File 'lib/dolly/document.rb', line 43

def doc=(value)
  @doc = value
end