Class: AlterEgo::RequestFilter
- Inherits:
-
Struct
- Object
- Struct
- AlterEgo::RequestFilter
- Defined in:
- lib/alter_ego.rb,
lib/alter_ego.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#new_state ⇒ Object
Returns the value of attribute new_state.
-
#request ⇒ Object
Returns the value of attribute request.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action
29 30 31 |
# File 'lib/alter_ego.rb', line 29 def action @action end |
#new_state ⇒ Object
Returns the value of attribute new_state
29 30 31 |
# File 'lib/alter_ego.rb', line 29 def new_state @new_state end |
#request ⇒ Object
Returns the value of attribute request
29 30 31 |
# File 'lib/alter_ego.rb', line 29 def request @request end |
#state ⇒ Object
Returns the value of attribute state
29 30 31 |
# File 'lib/alter_ego.rb', line 29 def state @state end |
Instance Method Details
#===(other) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/alter_ego.rb', line 35 def ===(other) result = (matches?(self.state, other.state) and matches?(self.request, other.request) and matches?(self.new_state, other.new_state)) result end |
#matches?(lhs, rhs) ⇒ Boolean
42 43 44 45 46 47 48 |
# File 'lib/alter_ego.rb', line 42 def matches?(lhs, rhs) if rhs.respond_to?(:include?) rhs.include?(lhs) else rhs == lhs end end |