Class: Atomic::Extensions::Cirrus::Announcement
- Defined in:
- lib/atomic/extensions/cirrus/announcement.rb
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Base
Methods included from Parser
Constructor Details
This class inherits a constructor from Atomic::Extensions::Cirrus::Base
Class Method Details
.mapping ⇒ Object
7 8 9 |
# File 'lib/atomic/extensions/cirrus/announcement.rb', line 7 def mapping [namespace, 'announcement'] end |
Instance Method Details
#handle_close_element(node) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/atomic/extensions/cirrus/announcement.rb', line 25 def handle_close_element(node) case [node.depth, node.uri, node.name] when [0, Announcement.namespace, 'announcement'] when [1, Announcement.namespace, 'message'] @parent.content[:message] = node.text when [1, Announcement.namespace, 'starts-at'] @parent.content[:starts_at] = node.text when [1, Announcement.namespace, 'ends-at'] @parent.content[:ends_at] = node.text else puts "Announcement ==>> Unexpected CLOSE #{node.depth} #{node.uri} #{node.name} #{node.attributes.inspect}" end end |
#handle_open_element(node, reader) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/atomic/extensions/cirrus/announcement.rb', line 12 def handle_open_element(node, reader) progressed = false case [node.depth, node.uri, node.name] when [0, Announcement.namespace, 'announcement'] when [1, Announcement.namespace, 'message'] when [1, Announcement.namespace, 'starts-at'] when [1, Announcement.namespace, 'ends-at'] else puts "Announcement ==>> Unexpected OPEN #{node.depth} #{node.uri} #{node.name} #{node.attributes.inspect}" end return progressed end |