Sha256: 12adb04eb2a593b1db0246c40a558a8f53a89c8d81aa2b6be8146979468ae2bc

Contents?: true

Size: 347 Bytes

Versions: 1

Compression:

Stored size: 347 Bytes

Contents

module Koine
  module Attributes
    class Attributes
      def initialize(object, attributes:)
        @object = object
        @attributes = attributes
      end

      def to_h
        {}.tap do |hash|
          @attributes.each do |name|
            hash[name.to_sym] = @object.send(name)
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
koine-attributes-0.1.4 lib/koine/attributes/attributes.rb