Sha256: 2b8ab3a7e448ac51e0d2b7150ce31a0b6c3899bcf3763ecd78afc961f8daed31

Contents?: true

Size: 431 Bytes

Versions: 1

Compression:

Stored size: 431 Bytes

Contents

module Dao
  class Endpoint
    Attrs = %w( api path route block doc )
    Attrs.each{|attr| attr_accessor(attr)}

    def initialize(options = {})
      update(options)
    end

    def update(options = {})
      options.each do |key, val|
        send("#{ key }=", val)
      end
    end

    def arity
      block.arity
    end

    def call(*args)
      block.call(*args)
    end

    def to_proc
      block
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dao-4.2.1 lib/dao/endpoint.rb