class RubyStackoverflow::Client::ResponseData

Attributes

data[R]
error[R]
has_more[R]

Public Class Methods

new(response, klass) click to toggle source
# File lib/ruby-stackoverflow/client/response_data.rb, line 6
def initialize(response, klass)
  if response[:items].nil?
    @error = StackoverflowError.new(response)
  else
    @data = format_data(response[:items], klass)
    @has_more = response[:has_more]
  end
end

Public Instance Methods

format_data(data, klass) click to toggle source
# File lib/ruby-stackoverflow/client/response_data.rb, line 15
def format_data(data, klass)
  eval(klass.capitalize).parse_data(data)
end