Class: Cpi::Event
- Inherits:
-
Object
- Object
- Cpi::Event
- Defined in:
- lib/cpi/event.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#event_type ⇒ Object
Returns the value of attribute event_type.
-
#event_uid ⇒ Object
Returns the value of attribute event_uid.
-
#source_tenant_uid ⇒ Object
Returns the value of attribute source_tenant_uid.
Instance Method Summary collapse
-
#initialize(attrs = nil) ⇒ Event
constructor
A new instance of Event.
- #xml ⇒ Object
Constructor Details
#initialize(attrs = nil) ⇒ Event
Returns a new instance of Event.
34 35 36 37 38 39 |
# File 'lib/cpi/event.rb', line 34 def initialize(attrs=nil) @event_type = attrs[:event_type] @source_tenant_uid = attrs[:source_tenant_uid] @event_uid = attrs[:event_uid] @content = attrs[:content] end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
32 33 34 |
# File 'lib/cpi/event.rb', line 32 def content @content end |
#event_type ⇒ Object
Returns the value of attribute event_type.
32 33 34 |
# File 'lib/cpi/event.rb', line 32 def event_type @event_type end |
#event_uid ⇒ Object
Returns the value of attribute event_uid.
32 33 34 |
# File 'lib/cpi/event.rb', line 32 def event_uid @event_uid end |
#source_tenant_uid ⇒ Object
Returns the value of attribute source_tenant_uid.
32 33 34 |
# File 'lib/cpi/event.rb', line 32 def source_tenant_uid @source_tenant_uid end |
Instance Method Details
#xml ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/cpi/event.rb', line 41 def xml builder = Nokogiri::XML::Builder.new do |xml| xml.cpi_event { xml.header { xml.event_uid event_uid xml.event_type event_type xml.source_tenant_uid source_tenant_uid } xml.content do xml << content end } end builder.doc.root.to_xml end |