Class: GoApiClient::Atom::Entry
- Inherits:
-
Object
- Object
- GoApiClient::Atom::Entry
- Includes:
- Helpers::SimpleAttributesSupport
- Defined in:
- lib/go_api_client/atom/entry.rb
Instance Attribute Summary collapse
-
#authors ⇒ Object
Returns the value of attribute authors.
-
#id ⇒ Object
Returns the value of attribute id.
-
#pipelines ⇒ Object
Returns the value of attribute pipelines.
-
#stage_href ⇒ Object
Returns the value of attribute stage_href.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Instance Method Summary collapse
-
#initialize(root, attributes = {}) ⇒ Entry
constructor
A new instance of Entry.
- #parse! ⇒ Object
Constructor Details
Instance Attribute Details
#authors ⇒ Object
Returns the value of attribute authors.
7 8 9 |
# File 'lib/go_api_client/atom/entry.rb', line 7 def @authors end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/go_api_client/atom/entry.rb', line 7 def id @id end |
#pipelines ⇒ Object
Returns the value of attribute pipelines.
7 8 9 |
# File 'lib/go_api_client/atom/entry.rb', line 7 def pipelines @pipelines end |
#stage_href ⇒ Object
Returns the value of attribute stage_href.
7 8 9 |
# File 'lib/go_api_client/atom/entry.rb', line 7 def stage_href @stage_href end |
#title ⇒ Object
Returns the value of attribute title.
7 8 9 |
# File 'lib/go_api_client/atom/entry.rb', line 7 def title @title end |
#updated_at ⇒ Object
Returns the value of attribute updated_at.
7 8 9 |
# File 'lib/go_api_client/atom/entry.rb', line 7 def updated_at @updated_at end |
Instance Method Details
#parse! ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/go_api_client/atom/entry.rb', line 16 def parse! self.updated_at = Time.parse(@root.xpath('xmlns:updated').first.content).utc self.id = @root.xpath('xmlns:id').first.content self.title = @root.xpath('xmlns:title').first.content self.stage_href = @root. xpath("xmlns:link[@type='application/vnd.go+xml' and @rel='alternate']"). first. attributes["href"].value self. = @root.xpath('xmlns:author').collect do || Author.new().parse! end @root = nil self end |