Class: Lexer::Identity::EnrichedResult
- Inherits:
-
Object
- Object
- Lexer::Identity::EnrichedResult
- Defined in:
- lib/lexer/identity/enriched_result.rb
Overview
The treturned result of an Lexer::Identity.enrich
request. Contains accessors for the returned id
and attributes
.
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#id ⇒ Object
Returns the value of attribute id.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ EnrichedResult
constructor
A new instance of EnrichedResult.
Constructor Details
#initialize(args) ⇒ EnrichedResult
Returns a new instance of EnrichedResult.
14 15 16 17 18 |
# File 'lib/lexer/identity/enriched_result.rb', line 14 def initialize(args) args.each do |k, v| instance_variable_set("@#{k}", v) unless v.nil? end end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
12 13 14 |
# File 'lib/lexer/identity/enriched_result.rb', line 12 def attributes @attributes end |
#id ⇒ Object
Returns the value of attribute id.
11 12 13 |
# File 'lib/lexer/identity/enriched_result.rb', line 11 def id @id end |
Class Method Details
.from_json(json) ⇒ Object
20 21 22 23 |
# File 'lib/lexer/identity/enriched_result.rb', line 20 def self.from_json(json) data = MultiJson.decode(json) Lexer::Identity::EnrichedResult.new(data) end |