Method: Consul::Guard#initialize

Defined in:
lib/consul/guard.rb

#initialize(*args) ⇒ Guard

Returns a new instance of Guard.



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/consul/guard.rb', line 49

def initialize(*args)

  args_copy = args.dup
  @options = args_copy.extract_options!

  default_power = args_copy.shift # might be nil

  custom_action_mappings = @options[:map]

  if @options[:crud]
    @map = ActionMap.crud(@options[:crud], custom_action_mappings)
  else
    @map = ActionMap.new(default_power, custom_action_mappings)
  end

end