Class: Badgeapi::Badge
- Inherits:
-
BadgeapiObject
- Object
- BadgeapiObject
- Badgeapi::Badge
- Defined in:
- lib/badgeapi/badge.rb
Instance Attribute Summary collapse
-
#auto_issue ⇒ Object
Returns the value of attribute auto_issue.
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#collection_id ⇒ Object
Returns the value of attribute collection_id.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#hint ⇒ Object
Returns the value of attribute hint.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#issued_at ⇒ Object
Returns the value of attribute issued_at.
-
#issuer_id ⇒ Object
Returns the value of attribute issuer_id.
-
#level ⇒ Object
Returns the value of attribute level.
-
#name ⇒ Object
Returns the value of attribute name.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#points ⇒ Object
readonly
Returns the value of attribute points.
-
#recipient_id ⇒ Object
Returns the value of attribute recipient_id.
-
#recipients ⇒ Object
readonly
Returns the value of attribute recipients.
-
#required_badges ⇒ Object
readonly
Returns the value of attribute required_badges.
-
#requirements ⇒ Object
Returns the value of attribute requirements.
-
#status ⇒ Object
Returns the value of attribute status.
-
#updated_at ⇒ Object
readonly
Returns the value of attribute updated_at.
Class Method Summary collapse
- .add_badge_requirement(id, required_id) ⇒ Object
- .issue(id, params = {}) ⇒ Object
- .remove_badge_requirement(id, required_id) ⇒ Object
- .revoke(id, params = {}) ⇒ Object
Methods inherited from BadgeapiObject
all, attribute_a_badge_object?, collection_name, create, destroy, find, from_response, handle_api_error, #inspect, map_instant_variables_to_child_records, map_instant_variables_to_record, map_json_to_object, map_related_object, member_name, object_classes, #remove_read_only_params, request, #save, update
Instance Attribute Details
#auto_issue ⇒ Object
Returns the value of attribute auto_issue.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def auto_issue @auto_issue end |
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
4 5 6 |
# File 'lib/badgeapi/badge.rb', line 4 def collection @collection end |
#collection_id ⇒ Object
Returns the value of attribute collection_id.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def collection_id @collection_id end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/badgeapi/badge.rb', line 4 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def description @description end |
#hint ⇒ Object
Returns the value of attribute hint.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def hint @hint end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/badgeapi/badge.rb', line 4 def id @id end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
4 5 6 |
# File 'lib/badgeapi/badge.rb', line 4 def image @image end |
#issued_at ⇒ Object
Returns the value of attribute issued_at.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def issued_at @issued_at end |
#issuer_id ⇒ Object
Returns the value of attribute issuer_id.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def issuer_id @issuer_id end |
#level ⇒ Object
Returns the value of attribute level.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def level @level end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def name @name end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/badgeapi/badge.rb', line 4 def object @object end |
#points ⇒ Object (readonly)
Returns the value of attribute points.
4 5 6 |
# File 'lib/badgeapi/badge.rb', line 4 def points @points end |
#recipient_id ⇒ Object
Returns the value of attribute recipient_id.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def recipient_id @recipient_id end |
#recipients ⇒ Object (readonly)
Returns the value of attribute recipients.
4 5 6 |
# File 'lib/badgeapi/badge.rb', line 4 def recipients @recipients end |
#required_badges ⇒ Object (readonly)
Returns the value of attribute required_badges.
4 5 6 |
# File 'lib/badgeapi/badge.rb', line 4 def required_badges @required_badges end |
#requirements ⇒ Object
Returns the value of attribute requirements.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def requirements @requirements end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/badgeapi/badge.rb', line 5 def status @status end |
#updated_at ⇒ Object (readonly)
Returns the value of attribute updated_at.
4 5 6 |
# File 'lib/badgeapi/badge.rb', line 4 def updated_at @updated_at end |
Class Method Details
.add_badge_requirement(id, required_id) ⇒ Object
17 18 19 |
# File 'lib/badgeapi/badge.rb', line 17 def add_badge_requirement id, required_id request "post", "#{Badgeapi.api_url}/#{collection_path}/#{id}/requires", required_badge: { id: required_id } end |
.issue(id, params = {}) ⇒ Object
9 10 11 |
# File 'lib/badgeapi/badge.rb', line 9 def issue id, params = {} request "post", "#{Badgeapi.api_url}/#{collection_path}/#{id}/issue", params end |