Class: Aoandon::StaticRule

Inherits:
Struct
  • Object
show all
Defined in:
lib/aoandon/static_rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ StaticRule

Returns a new instance of StaticRule.



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/aoandon/static_rule.rb', line 3

def initialize(*args)
  super(*args)

  self.context['from'] ||= {'addr' => 'any'}
  self.context['to'  ] ||= {'addr' => 'any'}

  self.context['from'].update('addr' => 'any') unless self.context['from']['addr']
  self.context['to'  ].update('addr' => 'any') unless self.context['to'  ]['addr']

  self.options ||= {}
  self.options.update('log' => false) unless self.options.has_key?('log')
end

Instance Attribute Details

#actionObject

Returns the value of attribute action

Returns:

  • (Object)

    the current value of action



2
3
4
# File 'lib/aoandon/static_rule.rb', line 2

def action
  @action
end

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



2
3
4
# File 'lib/aoandon/static_rule.rb', line 2

def context
  @context
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



2
3
4
# File 'lib/aoandon/static_rule.rb', line 2

def options
  @options
end