Class: BlockScore::Person

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

Constant Summary collapse

VALID =
'valid'.freeze
INVALID =
'invalid'.freeze

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes

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, endpoint, #inspect, #refresh, resource, #save, #save!

Methods included from Connection

#delete, #get, #patch, #post

Constructor Details

#initialize(options = {}) ⇒ Person

Returns a new instance of Person.



12
13
14
15
# File 'lib/blockscore/person.rb', line 12

def initialize(options = {})
  super
  @question_sets = Collection.new(QuestionSet.new(person: self))
end

Dynamic Method Handling

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

Instance Attribute Details

#question_setsObject (readonly)

Returns the value of attribute question_sets.



10
11
12
# File 'lib/blockscore/person.rb', line 10

def question_sets
  @question_sets
end

Instance Method Details

#invalid?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/blockscore/person.rb', line 21

def invalid?
  status?(INVALID)
end

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/blockscore/person.rb', line 17

def valid?
  status?(VALID)
end