Class: Cognito::Client::Resource

Inherits:
Object
  • Object
show all
Includes:
AbstractType, Memoizable
Defined in:
lib/cognito/client/resource.rb,
lib/cognito/client/resource/profile.rb,
lib/cognito/client/resource/identity_search.rb,
lib/cognito/client/resource/identity_assessment.rb,
lib/cognito/client/resource/identity_search_job.rb

Defined Under Namespace

Classes: Birth, Death, IdentityAssessment, IdentityRecord, IdentityRecordComparison, IdentitySearch, IdentitySearchJob, MissingRelation, NameComparison, PartialDate, PartialName, Phone, PhoneComparison, Profile, Registry, SSN, USAddress

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(relationships: nil, **options) ⇒ Resource

Returns a new instance of Resource.



64
65
66
# File 'lib/cognito/client/resource.rb', line 64

def initialize(relationships: nil, **options)
  super
end

Class Method Details

.attribute(key, method_name = key) ⇒ Object



41
42
43
44
45
# File 'lib/cognito/client/resource.rb', line 41

def self.attribute(key, method_name = key)
  define_method(method_name) do
    attributes[key]
  end
end

.build(data, parent) ⇒ Object



52
53
54
# File 'lib/cognito/client/resource.rb', line 52

def self.build(data, parent)
  new(data.merge(parent: parent))
end

Instance Method Details

#include(resource) ⇒ Object



56
57
58
# File 'lib/cognito/client/resource.rb', line 56

def include(resource)
  with(parent: parent.include(resource))
end

#includedObject



60
61
62
# File 'lib/cognito/client/resource.rb', line 60

def included
  parent.included
end