Class: Rule
- Inherits:
-
Object
- Object
- Rule
- Includes:
- MongoMapper::EmbeddedDocument, MongoMapper::Serialize
- Defined in:
- lib/question_chain/models/rule.rb
Direct Known Subclasses
Rules::AttributeChange, Rules::ChoiceGenerator, Rules::PopulateDropDown, Rules::Search, Rules::ValueChange
Class Method Summary collapse
-
.attributes_for_api ⇒ Object
have to have this here to declear all subclass not being used?.
Instance Method Summary collapse
-
#fire!(value, question_hash = {}) ⇒ TrueClass
this will manipulate the question hash with the updated attributes for the affecting ui objects that are attached to this rule.
- #ui_object_id ⇒ Object
Class Method Details
.attributes_for_api ⇒ Object
have to have this here to declear all subclass not being used?
15 16 17 |
# File 'lib/question_chain/models/rule.rb', line 15 def self.attributes_for_api %w(id fire_value _type ui_object_id negate_value) end |
Instance Method Details
#fire!(value, question_hash = {}) ⇒ TrueClass
this will manipulate the question hash with the updated attributes for the affecting ui objects that are attached to this rule
24 25 26 |
# File 'lib/question_chain/models/rule.rb', line 24 def fire!(value, question_hash = {}) raise NotImplementedError, "Need to set the fire! method" end |
#ui_object_id ⇒ Object
10 11 12 |
# File 'lib/question_chain/models/rule.rb', line 10 def ui_object_id _parent_document.id end |