Sha256: fbb669483a71f4d698cefb3cdcef4aefc750b19c34f733f63b6601c89d16cabe

Contents?: true

Size: 483 Bytes

Versions: 4

Compression:

Stored size: 483 Bytes

Contents

# frozen_string_literal: true

module Grape
  class Entity
    module Delegator
      class Base
        attr_reader :object

        def initialize(object)
          @object = object
        end

        def delegatable?(_attribute)
          true
        end

        def accepts_options?
          # Why not `arity > 1`? It might be negative https://ruby-doc.org/core-2.6.6/Method.html#method-i-arity
          method(:delegate).arity != 1
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
grape-entity-1.0.1 lib/grape_entity/delegator/base.rb
grape-entity-1.0.0 lib/grape_entity/delegator/base.rb
grape-entity-0.10.2 lib/grape_entity/delegator/base.rb
grape-entity-0.10.1 lib/grape_entity/delegator/base.rb