Class: Rule

Inherits:
Object
  • Object
show all
Includes:
MongoMapper::EmbeddedDocument, MongoMapper::Serialize
Defined in:
lib/question_chain/models/rule.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.attributes_for_apiObject

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

Returns:

  • (TrueClass)

    when the fire! is actually doing that

Raises:

  • (NotImplementedError)


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_idObject



10
11
12
# File 'lib/question_chain/models/rule.rb', line 10

def ui_object_id
  _parent_document.id
end