Sha256: 0f64fb9f1898c793736ec129b2867238e4fee51f8651c7159ab48e38e3068247
Contents?: true
Size: 423 Bytes
Versions: 205
Compression:
Stored size: 423 Bytes
Contents
# frozen_string_literal: true module EacRubyUtils class Compact attr_reader :object, :attributes def initialize(object, attributes) @object = object @attributes = attributes end # @return [Array] def to_a attributes.map { |attr| object.send(attr) } end # @return [Hash] def to_h attributes.map { |attr| [attr.to_sym, object.send(attr)] }.to_h end end end
Version data entries
205 entries across 205 versions & 4 rubygems