lib/pilha/stack_overflow/user.rb in pilha-0.1.1 vs lib/pilha/stack_overflow/user.rb in pilha-0.1.2

- old
+ new

@@ -15,15 +15,20 @@ def initialize(hash) @struct = OpenStruct.new hash end + def id + @struct.user_id + end + class << self attr_reader :client - def find_by_badge_id(id, query_options = {}) - response = client.get client.api_method_url('/badges/:id', :id => id, :query => query_options) + def find_by_badge_id(id, options = {}) + options.merge! :id => id + response = client.request('/badges/:id', options) users = response['users'].map { |user| User.new(user) } response['users'] = users OpenStruct.new response end end