Sha256: 8f3b38545c2bac97c08851a0f6a46c8dc926ec530a78f05c70e32c48d7040b78

Contents?: true

Size: 487 Bytes

Versions: 1

Compression:

Stored size: 487 Bytes

Contents

module Bling
  module API
    class Record

      # @return [Hash] The original hash attributes passed on initialize
      attr_reader :attrs

      # @params [Hash] A hash that will generate accessors for each key
      def initialize(hash)
        @attrs = hash
      end

      private

      def method_missing(method, *args, &block)
        if attrs.has_key?(method)
          attrs[method]
        else
          super(method, args, block)
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bling-ruby-api-0.0.1 lib/bling/api/record.rb