Sha256: 38f5da59de03d41421c6f438f55257e6ddb815d410c765039954afb81d0eb402

Contents?: true

Size: 450 Bytes

Versions: 1

Compression:

Stored size: 450 Bytes

Contents

module WithingsSDK
  class Base
    # @return [Hash]
    attr_reader :attrs

    # Initializes a new object with attributes for the values passed to the constructor.
    #
    # @param attrs [Hash]
    # @return [WithingsSDK::Base]
    def initialize(attrs = {})
      @attrs = attrs || {}
      @attrs.each do |key, value|
        self.class.class_eval { attr_reader key }
        instance_variable_set("@#{key}", value)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
withings-sdk-0.2.1 lib/withings-sdk/base.rb