Class: YiffSpace::Utils::SetEnvConstraint
- Inherits:
-
Object
- Object
- YiffSpace::Utils::SetEnvConstraint
- Defined in:
- lib/yiffspace/utils/set_env_constraint.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(key, value) ⇒ SetEnvConstraint
constructor
A new instance of SetEnvConstraint.
- #matches?(request) ⇒ Boolean
Constructor Details
#initialize(key, value) ⇒ SetEnvConstraint
Returns a new instance of SetEnvConstraint.
8 9 10 11 |
# File 'lib/yiffspace/utils/set_env_constraint.rb', line 8 def initialize(key, value) @key = key.to_s @value = value end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/yiffspace/utils/set_env_constraint.rb', line 6 def key @key end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/yiffspace/utils/set_env_constraint.rb', line 6 def value @value end |
Instance Method Details
#matches?(request) ⇒ Boolean
13 14 15 |
# File 'lib/yiffspace/utils/set_env_constraint.rb', line 13 def matches?(request) request.env[key.to_s] = value end |