Class: Atomizer::Service
Instance Method Summary collapse
-
#initialize(*attrs) ⇒ Service
constructor
A new instance of Service.
- #setup_workspace(collection = nil) ⇒ Object
- #to_xml(xml) ⇒ Object
Methods inherited from FeedItem
feed_attributes, feed_no_collection_group_tag, feed_no_collection_group_tag!, feed_tag_name
Methods included from Buildable
Constructor Details
#initialize(*attrs) ⇒ Service
Returns a new instance of Service.
6 7 8 9 |
# File 'lib/atomizer/service.rb', line 6 def initialize(*attrs) super(*attrs) @workspaces ||= [] end |
Instance Method Details
#setup_workspace(collection = nil) ⇒ Object
19 20 21 22 23 |
# File 'lib/atomizer/service.rb', line 19 def setup_workspace(collection=nil) workspace = Workspace.new workspace.collections << collection if collection self.workspaces << workspace end |
#to_xml(xml) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/atomizer/service.rb', line 11 def to_xml(xml) xml.service :xmlns => "http://www.w3.org/2007/app", :"xmlns:atom" => "http://www.w3.org/2005/Atom" do workspaces.each do |workspace| workspace.to_xml xml end end end |