Class: Twizo::Entity
- Inherits:
-
Object
- Object
- Twizo::Entity
- Defined in:
- lib/twizo/entity.rb
Constant Summary collapse
- ACTION_CREATE =
http method actions
'POST'
- ACTION_UPDATE =
'PUT'
- ACTION_RETRIEVE =
'GET'
- ACTION_REMOVE =
'DELETE'
Instance Method Summary collapse
-
#initialize(client) ⇒ Entity
constructor
Constructor.
- #populate(id, widget_recipient = nil, widget_backup_code_id = nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ Entity
Constructor
32 33 34 |
# File 'lib/twizo/entity.rb', line 32 def initialize(client) @client = client end |
Instance Method Details
#populate(id, widget_recipient = nil, widget_backup_code_id = nil) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/twizo/entity.rb', line 43 def populate(id, = nil, = nil) raise 'Error: id not provided' unless id params = id params += "?recipient=#{}" if params += "&backupCodeIdentifier=#{}" if response = send_api_call(ACTION_RETRIEVE, "#{location}/#{params}") raise response if response.kind_of?(TwizoError) response_to_array(response) end |