Sha256: 93a7739da6bfaa51c36ddd01e340920b54a2f243fb3661b8667cb9f1a30dbb4b

Contents?: true

Size: 661 Bytes

Versions: 3

Compression:

Stored size: 661 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

3 entries across 3 versions & 1 rubygems

Version Path
mutils-1.1.0 lib/mutils/serialization/results/attributes.rb
mutils-1.0.1 lib/mutils/serialization/results/attributes.rb
mutils-1.0.0 lib/mutils/serialization/results/attributes.rb