Sha256: 3cd0434230c22bae9a5825ec46bce956f1cd0368d63ec6464762488aaf778100

Contents?: true

Size: 432 Bytes

Versions: 5

Compression:

Stored size: 432 Bytes

Contents

module Marver
  class DataContainer
    attr_reader :offset, :limit, :total, :results

    def initialize(response)
      json_results = response.data

      @offset = json_results['offset'].to_i
      @limit = json_results['limit'].to_i
      @total = json_results['total'].to_i
      if @total == 1
        @results = json_results['results'].first
      else
        @results = json_results['results']
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
marver-0.1.0 lib/marver/data_container.rb
marver-0.0.6 lib/marver/data_container.rb
marver-0.0.5 lib/marver/data_container.rb
marver-0.0.4 lib/marver/data_container.rb
marver-0.0.2 lib/marver/data_container.rb