Sha256: 53be2abd755aead913e008559f4a330cb024dcf3e4f9fb1fa2aa887f1a7bbff6

Contents?: true

Size: 667 Bytes

Versions: 8

Compression:

Stored size: 667 Bytes

Contents

# frozen_string_literal: true

# Module Mutils
module Mutils
  module Serialization
    # Module Results
    module Results
      # Module Attributes
      module Attributes
        def fetch_block_attributes(attributes, result_hash)
          attributes&.each do |key, s_options|
            result_hash[key] = s_options[:block].call(scope, options[:params] || {})
          end
        end

        def fetch_attributes(attributes, result_hash)
          attributes&.each do |key, s_options|
            check_if_included(s_options, key) && (result_hash[key] = s_options[:method] ? send(key) : scope.send(key))
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
mutils-1.1.8 lib/mutils/serialization/results/attributes.rb
mutils-1.1.7 lib/mutils/serialization/results/attributes.rb
mutils-1.1.6 lib/mutils/serialization/results/attributes.rb
mutils-1.1.5 lib/mutils/serialization/results/attributes.rb
mutils-1.1.4 lib/mutils/serialization/results/attributes.rb
mutils-1.1.3 lib/mutils/serialization/results/attributes.rb
mutils-1.1.2 lib/mutils/serialization/results/attributes.rb
mutils-1.1.1 lib/mutils/serialization/results/attributes.rb