Sha256: 2cd0be061631a54897fefd7ae3e5037daa6e7fabe1ddd14135809e948504ae50

Contents?: true

Size: 326 Bytes

Versions: 2

Compression:

Stored size: 326 Bytes

Contents

# frozen_string_literal: true

require 'ipaddr'
require 'json'

module IPinfo
  class Response

    attr_reader :all

    def initialize(response)
      @all = response

      @all.each do |name, value|
        instance_variable_set("@#{name}", value)
        self.class.send(:attr_accessor, name)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
IPinfo-0.1.2 lib/ipinfo/response.rb
IPinfo-0.1.1 lib/ipinfo/response.rb