Class: Mense::Person
- Includes:
- Client
- Defined in:
- lib/mense/person.rb
Defined Under Namespace
Classes: Email
Instance Attribute Summary collapse
-
#likelihood ⇒ Object
readonly
Returns the value of attribute likelihood.
Class Method Summary collapse
- .enrich(params = {}) ⇒ Object
- .retrieve(id, params = {}) ⇒ Object (also: find)
- .search(params = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Person
constructor
A new instance of Person.
Methods included from Client
Constructor Details
#initialize(attributes = {}) ⇒ Person
21 22 23 24 |
# File 'lib/mense/person.rb', line 21 def initialize(attributes = {}) @likelihood = attributes["likelihood"] super(attributes["data"]) end |
Instance Attribute Details
#likelihood ⇒ Object (readonly)
Returns the value of attribute likelihood.
19 20 21 |
# File 'lib/mense/person.rb', line 19 def likelihood @likelihood end |
Class Method Details
.enrich(params = {}) ⇒ Object
26 27 28 29 30 |
# File 'lib/mense/person.rb', line 26 def self.enrich(params = {}) response = get('/person/enrich', query: params, headers: { "X-API-Key" => Mense.api_key }) self.new(response) end |
.retrieve(id, params = {}) ⇒ Object Also known as: find
39 40 41 42 43 |
# File 'lib/mense/person.rb', line 39 def self.retrieve(id, params = {}) response = get("/person/retrieve/#{id}", query: params, headers: { "X-API-Key" => Mense.api_key }) self.new(response) end |
.search(params = {}) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/mense/person.rb', line 32 def self.search(params = {}) response = get("/person/search", query: params, headers: { "X-API-Key" => Mense.api_key, "Content-Type" => "application/json"}) response end |