Class: IdentityMind::Entity
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- IdentityMind::Entity
- Defined in:
- lib/identity_mind/entity.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(json_payload) ⇒ Entity
constructor
A new instance of Entity.
Constructor Details
#initialize(json_payload) ⇒ Entity
Returns a new instance of Entity.
3 4 5 |
# File 'lib/identity_mind/entity.rb', line 3 def initialize(json_payload) super(JSON.parse(json_payload, symbolize_names: true)) end |
Class Method Details
.create(params) ⇒ Object
12 13 14 |
# File 'lib/identity_mind/entity.rb', line 12 def create(params) new(IdentityMind.post(path, body: Params[params].to_json).body) end |
.fetch(transaction_id) ⇒ Object
16 17 18 |
# File 'lib/identity_mind/entity.rb', line 16 def fetch(transaction_id) new(IdentityMind.get("#{path}/#{transaction_id}").body) end |
.path ⇒ Object
8 9 10 |
# File 'lib/identity_mind/entity.rb', line 8 def path "/im/#{to_s.split('::')[1..-1].map!(&:downcase).join('/')}" end |