Module: Unloq::Achievements
- Included in:
- Client
- Defined in:
- lib/unloq/achievements.rb
Instance Method Summary collapse
-
#create_achievement(verb, observation_count, author: nil, recipient: nil, author_type: nil, recipient_type: nil, points: nil, image_path: nil) ⇒ Object
Create an achievement via the Unloq API.
Instance Method Details
#create_achievement(verb, observation_count, author: nil, recipient: nil, author_type: nil, recipient_type: nil, points: nil, image_path: nil) ⇒ Object
Create an achievement via the Unloq API
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/unloq/achievements.rb', line 15 def create_achievement verb, observation_count, author: nil, recipient: nil, author_type: nil, recipient_type: nil, points: nil, image_path: nil , = extract_entity_details(, ) recipient_type, recipient_id = extract_entity_details(recipient, recipient_type) body_to_post = { verb: verb, observation_count: observation_count, author_id: , author_type: , recipient_id: recipient_id, recipient_type: recipient_type, points: points, image_path: image_path } post('/achievements', body_to_post) end |