Class: InstanceId
- Inherits:
-
Object
- Object
- InstanceId
- Includes:
- HTTParty
- Defined in:
- lib/instance_id.rb,
lib/instance_id/version.rb
Constant Summary collapse
- VERSION =
"0.1.0"
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
Instance Method Summary collapse
- #add_topic(registration_tokens, topic) ⇒ Object
- #info(registration_token) ⇒ Object
-
#initialize(api_key, client_options = {}) ⇒ InstanceId
constructor
A new instance of InstanceId.
- #remove_topic(registration_tokens, topic) ⇒ Object
Constructor Details
#initialize(api_key, client_options = {}) ⇒ InstanceId
Returns a new instance of InstanceId.
15 16 17 18 |
# File 'lib/instance_id.rb', line 15 def initialize(api_key, = {}) @api_key = api_key @client_options = end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
13 14 15 |
# File 'lib/instance_id.rb', line 13 def api_key @api_key end |
#timeout ⇒ Object
Returns the value of attribute timeout.
13 14 15 |
# File 'lib/instance_id.rb', line 13 def timeout @timeout end |
Instance Method Details
#add_topic(registration_tokens, topic) ⇒ Object
20 21 22 |
# File 'lib/instance_id.rb', line 20 def add_topic(registration_tokens, topic) manage_relationship_maps(registration_tokens, topic, :add) end |
#info(registration_token) ⇒ Object
28 29 30 31 |
# File 'lib/instance_id.rb', line 28 def info(registration_token) response = self.class.get("/info/#{registration_token}?details=true", build_params) Hashie::Mash.new(response) if response.code == 200 end |
#remove_topic(registration_tokens, topic) ⇒ Object
24 25 26 |
# File 'lib/instance_id.rb', line 24 def remove_topic(registration_tokens, topic) manage_relationship_maps(registration_tokens, topic, :remove) end |