Class: LivePaper::ShortTrigger
- Inherits:
-
Trigger
- Object
- BaseObject
- Trigger
- LivePaper::ShortTrigger
- Defined in:
- lib/live_paper/short_trigger.rb
Constant Summary
Constants inherited from BaseObject
BaseObject::AUTH_URL, BaseObject::AUTH_VALIDATION_URL, BaseObject::LP_API_HOST
Instance Attribute Summary collapse
-
#short_url ⇒ Object
Returns the value of attribute short_url.
Attributes inherited from Trigger
#end_date, #start_date, #state
Attributes inherited from BaseObject
#date_created, #date_modified, #id, #link, #name
Instance Method Summary collapse
Methods inherited from Trigger
api_url, #default_end_date, #default_start_date, item_key, list_key, parse
Methods inherited from BaseObject
api_url, #assign_attributes, create, #delete, #errors, get, #initialize, item_key, list, list_key, parse, #rel, request_access_token, request_project_id, rest_request, #save, #update
Constructor Details
This class inherits a constructor from LivePaper::BaseObject
Instance Attribute Details
#short_url ⇒ Object
Returns the value of attribute short_url.
5 6 7 |
# File 'lib/live_paper/short_trigger.rb', line 5 def short_url @short_url end |
Instance Method Details
#parse(data) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/live_paper/short_trigger.rb', line 7 def parse(data) data = JSON.parse(data, symbolize_names: true)[:trigger] assign_attributes data self.short_url=data[:link].select { |item| item[:rel] == "shortURL" }.first[:href] self end |