Class: GDocsAPIWrapper::Models::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/gdocsapi-wrapper/models/document.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#authorObject

Returns the value of attribute author.



31
32
33
# File 'lib/gdocsapi-wrapper/models/document.rb', line 31

def author
  @author
end

Returns the value of attribute link.



30
31
32
# File 'lib/gdocsapi-wrapper/models/document.rb', line 30

def link
  @link
end

#publishedObject

Returns the value of attribute published.



28
29
30
# File 'lib/gdocsapi-wrapper/models/document.rb', line 28

def published
  @published
end

#titleObject

Returns the value of attribute title.



27
28
29
# File 'lib/gdocsapi-wrapper/models/document.rb', line 27

def title
  @title
end

#updatedObject

Returns the value of attribute updated.



29
30
31
# File 'lib/gdocsapi-wrapper/models/document.rb', line 29

def updated
  @updated
end

Class Method Details

.parse(element) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/gdocsapi-wrapper/models/document.rb', line 33

def self.parse(element)
  document = GDocsAPIWrapper::Models::Document.new
  
  document.title = element.elements['title'].text
  document.published = DateTime.parse(element.elements['published'].text)
  document.updated = DateTime.parse(element.elements['updated'].text)
  document.link = element.elements['link[@rel="alternate"]'].attributes['href']
  document.author = GDocsAPIWrapper::Models::Author.parse(element.elements['author'])
  
  return document
end