Class: BlockScore::QuestionSet

Inherits:
Base
  • Object
show all
Extended by:
Forwardable
Includes:
Actions::All, Actions::Create, Actions::Retrieve
Defined in:
lib/blockscore/question_set.rb

Instance Method Summary collapse

Methods included from Actions::All

included

Methods included from Actions::Retrieve

included

Methods included from Actions::Create

included

Methods inherited from Base

api_url, #attributes, endpoint, #force!, #id, #initialize, #inspect, #persisted?, #refresh, resource, #save, #save!

Methods included from Connection

#delete, #get, #patch, #post

Constructor Details

This class inherits a constructor from BlockScore::Base

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BlockScore::Base

Instance Method Details

#score(answers = nil) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/blockscore/question_set.rb', line 11

def score(answers = nil)
  if answers.nil? && attributes
    attributes[:score]
  else
    post "#{endpoint}/#{id}/score", answers: answers
  end
end