ruby-grape/grape-entity

View on GitHub
lib/grape_entity/delegator/hash_object.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Grape
  class Entity
    module Delegator
      class HashObject < Base
        def delegate(attribute, hash_access: :to_sym)
          object[attribute.send(hash_access)]
        end
      end
    end
  end
end