Class: Rubyoverflow::Badge
Instance Attribute Summary collapse
-
#award_count ⇒ Object
readonly
Returns the value of attribute award_count.
-
#badge_id ⇒ Object
readonly
Returns the value of attribute badge_id.
-
#badges_recipients_url ⇒ Object
readonly
Returns the value of attribute badges_recipients_url.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#rank ⇒ Object
readonly
Returns the value of attribute rank.
-
#tag_based ⇒ Object
readonly
Returns the value of attribute tag_based.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#get_recipients(parameters = {}) ⇒ Object
Retrieves all the users that have received the badge.
-
#initialize(hash, request_path = '') ⇒ Badge
constructor
A new instance of Badge.
- #item_id ⇒ Object
Methods inherited from Base
change_end_point, client, convert_if_array, convert_to_id_list, #find_parse_querystring, request, #request
Constructor Details
#initialize(hash, request_path = '') ⇒ Badge
Returns a new instance of Badge.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rubyoverflow/badge.rb', line 5 def initialize(hash, request_path = '') dash = BadgeDash.new hash @badge_id = dash.badge_id @rank = dash.rank @name = dash.name @description = dash.description @award_count = dash.award_count @tag_based = dash.tag_based @user = User.new dash.user if dash.user @badges_recipients_url = dash.badges_recipients_url end |
Instance Attribute Details
#award_count ⇒ Object (readonly)
Returns the value of attribute award_count.
3 4 5 |
# File 'lib/rubyoverflow/badge.rb', line 3 def award_count @award_count end |
#badge_id ⇒ Object (readonly)
Returns the value of attribute badge_id.
3 4 5 |
# File 'lib/rubyoverflow/badge.rb', line 3 def badge_id @badge_id end |
#badges_recipients_url ⇒ Object (readonly)
Returns the value of attribute badges_recipients_url.
3 4 5 |
# File 'lib/rubyoverflow/badge.rb', line 3 def badges_recipients_url @badges_recipients_url end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/rubyoverflow/badge.rb', line 3 def description @description end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/rubyoverflow/badge.rb', line 3 def name @name end |
#rank ⇒ Object (readonly)
Returns the value of attribute rank.
3 4 5 |
# File 'lib/rubyoverflow/badge.rb', line 3 def rank @rank end |
#tag_based ⇒ Object (readonly)
Returns the value of attribute tag_based.
3 4 5 |
# File 'lib/rubyoverflow/badge.rb', line 3 def tag_based @tag_based end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
3 4 5 |
# File 'lib/rubyoverflow/badge.rb', line 3 def user @user end |
Instance Method Details
#get_recipients(parameters = {}) ⇒ Object
Retrieves all the users that have received the badge
23 24 25 26 27 28 29 30 |
# File 'lib/rubyoverflow/badge.rb', line 23 def get_recipients(parameters = {}) if @badges_recipients_url hash,url =request(@badges_recipients_url, parameters) Users.new hash, url else nil end end |
#item_id ⇒ Object
18 19 20 |
# File 'lib/rubyoverflow/badge.rb', line 18 def item_id @badge_id end |