Method: Webbed::Method#initialize

Defined in:
lib/webbed/method.rb

#initialize(name, options = {}) ⇒ Method

Creates a new Method.

Parameters:

  • name (String)

    the name of the Method to create

  • options (Hash) (defaults to: {})

    the options to create the Method with

Options Hash (options):

  • :safe (Boolean) — default: false

    whether or not the Method is safe

  • :idempotent (Boolean) — default: false

    whether or not the Method is idempotent

  • :allowable_entities (Array<:request, :response>) — default: [:request, :response]

    the allowable entites of a message



45
46
47
48
49
50
51
# File 'lib/webbed/method.rb', line 45

def initialize(name, options = {})
  options = DEFAULTS.merge(options)
  @name = name
  @safe = options[:safe]
  @idempotent = options[:safe] || options[:idempotent]
  @allowable_entities = options[:allowable_entities]
end