Class: AQI::OutcomeEvents
- Inherits:
-
Object
- Object
- AQI::OutcomeEvents
- Defined in:
- lib/aqi/outcome_events.rb
Instance Attribute Summary collapse
-
#event_preparer ⇒ Object
Returns the value of attribute event_preparer.
-
#ic_events ⇒ Object
Returns the value of attribute ic_events.
-
#outcomes ⇒ Object
Returns the value of attribute outcomes.
-
#outcomes_preparer ⇒ Object
Returns the value of attribute outcomes_preparer.
Instance Method Summary collapse
-
#initialize(options) ⇒ OutcomeEvents
constructor
A new instance of OutcomeEvents.
- #prepare ⇒ Object
- #prepare_ic_events ⇒ Object
- #prepare_outcomes ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(options) ⇒ OutcomeEvents
Returns a new instance of OutcomeEvents.
4 5 6 7 8 9 10 |
# File 'lib/aqi/outcome_events.rb', line 4 def initialize() @event_preparer = .delete(:event_preparer) || AQI::ICEventsPreparer @ic_events = .delete(:ic_events) || [] @outcomes_preparer = .delete(:outcomes_preparer) || AQI::OutcomesPreparer @outcomes = .delete(:outcomes) || [] prepare end |
Instance Attribute Details
#event_preparer ⇒ Object
Returns the value of attribute event_preparer.
3 4 5 |
# File 'lib/aqi/outcome_events.rb', line 3 def event_preparer @event_preparer end |
#ic_events ⇒ Object
Returns the value of attribute ic_events.
3 4 5 |
# File 'lib/aqi/outcome_events.rb', line 3 def ic_events @ic_events end |
#outcomes ⇒ Object
Returns the value of attribute outcomes.
3 4 5 |
# File 'lib/aqi/outcome_events.rb', line 3 def outcomes @outcomes end |
#outcomes_preparer ⇒ Object
Returns the value of attribute outcomes_preparer.
3 4 5 |
# File 'lib/aqi/outcome_events.rb', line 3 def outcomes_preparer @outcomes_preparer end |
Instance Method Details
#prepare ⇒ Object
12 13 14 15 |
# File 'lib/aqi/outcome_events.rb', line 12 def prepare prepare_ic_events prepare_outcomes end |
#prepare_ic_events ⇒ Object
17 18 19 |
# File 'lib/aqi/outcome_events.rb', line 17 def prepare_ic_events self.ic_events = event_preparer.prepare_ic_events(self) end |
#prepare_outcomes ⇒ Object
21 22 23 |
# File 'lib/aqi/outcome_events.rb', line 21 def prepare_outcomes self.outcomes = outcomes_preparer.prepare_outcomes(self) end |
#to_xml ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/aqi/outcome_events.rb', line 25 def to_xml builder = Builder::XmlMarkup.new builder.OutcomesEvents do |oe| oe.ICEventSet do |ic_set| self.ic_events.each do |event| ic_set.ICEvent << event.to_xml end end oe.OutcomeSet do |outcome_set| self.outcomes.each do |outcome| outcome_set.Outcome << outcome.to_xml end end end end |