Class: Question

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.attributes_for_apiObject

Hooks



26
27
28
# File 'lib/question_chain/models/question.rb', line 26

def self.attributes_for_api
  %w(id name description computation_id ui_groups label calculator_id)
end

Instance Method Details

#to_hashObject



34
35
36
# File 'lib/question_chain/models/question.rb', line 34

def to_hash
  Hashie::Mash.new(attributes_for_api_resources)
end

#to_jsonObject



30
31
32
# File 'lib/question_chain/models/question.rb', line 30

def to_json
  attributes_for_api_resource.to_json
end