unloq 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7897418f6ca8c9fc33545aae4d46bccb0b54e56
4
- data.tar.gz: 39d379fe3dbc9d56baaa4ea646757e59484e1d70
3
+ metadata.gz: 484a542107975d1eddde65b5457ddaa4c90d5be8
4
+ data.tar.gz: 845a68b9301f4d9163368097bfa5a98e4dcdc2c9
5
5
  SHA512:
6
- metadata.gz: bdde0af33b9ca715b957d9a42bb45d3c74b0257e167a4752e3f096d10d0207c83ade10c0a84ab071acef278d996b8fe1b2e47ffd8e0f33c4053618fd163a4e34
7
- data.tar.gz: ce701c4a86e4739aa93f9bc7483c3edf60c23015be138bf65cd797251fdcc7de36688f1c27ebaf8d510f0877621f7855860fb63d01da54dd5fa08568329c76c2
6
+ metadata.gz: 98c959380035e40cbd043e3d12840061e713b22c859885f7ff293d7a56bd126a3729dcec9b6be33dff47ffc8bfa06fd30940801dae584be6b67cb74c67d060b6
7
+ data.tar.gz: 22fb4a91441992cd467335ed60c15a64a45754800ec4616d3b9bec53ddd4b196e0236376eee35fce3f636c58dad99e1eb7b384b7b92b8185836cbee6eb7a96fe
@@ -3,8 +3,8 @@ module Unloq
3
3
 
4
4
  # Create an achievement via the Unloq API
5
5
  #
6
- # @param verb [String] verb The verb for which this achievement should be unlocked
7
- # @param observation_count [Integer] observation_count The number of times the event must occur to unlock this achievement
6
+ # @param verb [String] The verb for which this achievement should be unlocked
7
+ # @param observation_count [Integer] The number of times the event must occur to unlock this achievement
8
8
  # @param author [Unloq::Entity] An individual author, if passed this achievement will only be attainable by this author. Required if author_type is not defined.
9
9
  # @param recipient [Unloq::Entity] An individual recipient that must be acted on to attain this achievement. Required if recipient_type is not defined.
10
10
  # @param author_type [String] An individual author type, if passed this achievement will only be attaintable by authors of this type. Required if author is not defined.
data/lib/unloq/client.rb CHANGED
@@ -8,8 +8,8 @@ module Unloq
8
8
 
9
9
  # Initialize the client class that will be used for all Unloq interactions.
10
10
  #
11
- # @param [String] api_key Your Unloq api key.
12
- # @param [String] namespace The namespace under which Unloq events should be created, e.g. appname-dev
11
+ # @param api_key [String] Your Unloq api key.
12
+ # @param namespace [String] The namespace under which Unloq events should be created, e.g. appname-dev
13
13
 
14
14
  def initialize api_key: nil, namespace: nil
15
15
  unless api_key && namespace
@@ -22,8 +22,8 @@ module Unloq
22
22
 
23
23
  # Make a post request to the Unloq API
24
24
  #
25
- # @param [String] endpoint The resource endpoint, e.g. /events
26
- # @param [Hash] body The body payload that should be POSTed
25
+ # @param endpoint [String] The resource endpoint, e.g. /events
26
+ # @param body [Hash] The body payload that should be POSTed
27
27
 
28
28
  def post endpoint, body = {}
29
29
  body.merge!(api_key: api_key, namespace: namespace)
data/lib/unloq/entity.rb CHANGED
@@ -2,6 +2,10 @@ module Unloq
2
2
  class Entity
3
3
  attr_reader :id, :type, :meta
4
4
 
5
+ # Initialize an instance of an unloq entity. This has subclasses for Author and Recipient for ease of understanding.
6
+ # @param id [String] The ID of the entity (may also be an integer), e.g. 1 or '1'
7
+ # @param type [String] The type of the entity, e.g. 'User'
8
+
5
9
  def initialize id: nil, type: nil, meta: {}
6
10
  unless id && type
7
11
  raise ArgumentError.new("You must include both an id and a type, e.g. #{self.class.to_s}.new(id: 1, type: 'User')")
data/lib/unloq/events.rb CHANGED
@@ -3,10 +3,10 @@ module Unloq
3
3
 
4
4
  # Create an event via the Unloq API
5
5
  #
6
- # @param [Unloq::Entity] author Author involved in the event
7
- # @param [String] verb The verb of the event
8
- # @param [Unloq::Entity] recipient Recipient involved in the event
9
- # @param [Hash] meta A hash of additional metadata to send with the request
6
+ # @param author [Unloq::Entity] Author involved in the event
7
+ # @param verb [String] The verb of the event
8
+ # @param recipient [Unloq::Entity] Recipient involved in the event
9
+ # @param meta [Hash] A hash of additional metadata to send with the request
10
10
 
11
11
  def create_event author, verb, recipient, meta = {}
12
12
  validate_author(author)
data/lib/unloq/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Unloq
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: unloq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Mueller