Class: Googletastic::Base

Inherits:
Hash
  • Object
show all
Includes:
Mixins::Actions, Mixins::Attributes, Mixins::Finders, Mixins::Namespaces, Mixins::Pagination, Mixins::Parsing, Mixins::Requesting
Defined in:
lib/googletastic/base.rb

Constant Summary

Constants included from Mixins::Namespaces

Mixins::Namespaces::NAMESPACES

Instance Attribute Summary collapse

Attributes included from Mixins::Attributes

#attributes

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Mixins::Pagination

included

Methods included from Mixins::Finders

included

Methods included from Mixins::Parsing

included

Methods included from Mixins::Requesting

included

Methods included from Mixins::Attributes

#attribute_names, #has_attribute?, #inspect

Methods included from Mixins::Namespaces

included

Constructor Details

#initialize(attributes = {}) ⇒ Base

Returns a new instance of Base.



30
31
32
# File 'lib/googletastic/base.rb', line 30

def initialize(attributes = {})
  self.attributes = attributes unless attributes.nil?
end

Instance Attribute Details

#aclObject

Returns the value of attribute acl.



16
17
18
# File 'lib/googletastic/base.rb', line 16

def acl
  @acl
end

#attachment_pathObject

for docs, images…



18
19
20
# File 'lib/googletastic/base.rb', line 18

def attachment_path
  @attachment_path
end

#created_atObject

Returns the value of attribute created_at.



17
18
19
# File 'lib/googletastic/base.rb', line 17

def created_at
  @created_at
end

#etagObject

ID’s are specifically the hash key for each entry. They don’t include the url for finding the document, which can be inferred from the “action” you’re taking on it, and the general api.



15
16
17
# File 'lib/googletastic/base.rb', line 15

def etag
  @etag
end

#headObject

ID’s are specifically the hash key for each entry. They don’t include the url for finding the document, which can be inferred from the “action” you’re taking on it, and the general api.



15
16
17
# File 'lib/googletastic/base.rb', line 15

def head
  @head
end

#idObject

ID’s are specifically the hash key for each entry. They don’t include the url for finding the document, which can be inferred from the “action” you’re taking on it, and the general api.



15
16
17
# File 'lib/googletastic/base.rb', line 15

def id
  @id
end

#keep_rawObject

Returns the value of attribute keep_raw.



22
23
24
# File 'lib/googletastic/base.rb', line 22

def keep_raw
  @keep_raw
end

#rawObject

Returns the value of attribute raw.



23
24
25
# File 'lib/googletastic/base.rb', line 23

def raw
  @raw
end

#responseObject

Returns the value of attribute response.



21
22
23
# File 'lib/googletastic/base.rb', line 21

def response
  @response
end

#synced_withObject

classes/records it is synced with



20
21
22
# File 'lib/googletastic/base.rb', line 20

def synced_with
  @synced_with
end

#updated_atObject

Returns the value of attribute updated_at.



17
18
19
# File 'lib/googletastic/base.rb', line 17

def updated_at
  @updated_at
end

Class Method Details

.client_classObject

This is referring to the gdata gem’s implementation, which more closely maps to the google api override if you name classes differently.



39
40
41
# File 'lib/googletastic/base.rb', line 39

def client_class
  self.to_s.split("::").last
end

Instance Method Details

#to_xmlObject



45
46
47
# File 'lib/googletastic/base.rb', line 45

def to_xml
  self.class.marshall(self)
end