Class: Tram::Policy::Validator
- Inherits:
-
Object
- Object
- Tram::Policy::Validator
- Defined in:
- lib/tram/policy/validator.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#stop_on_failure ⇒ Object
readonly
Returns the value of attribute stop_on_failure.
Instance Method Summary collapse
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
4 5 6 |
# File 'lib/tram/policy/validator.rb', line 4 def block @block end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/tram/policy/validator.rb', line 4 def name @name end |
#stop_on_failure ⇒ Object (readonly)
Returns the value of attribute stop_on_failure.
4 5 6 |
# File 'lib/tram/policy/validator.rb', line 4 def stop_on_failure @stop_on_failure end |
Instance Method Details
#==(other) ⇒ Object
6 7 8 |
# File 'lib/tram/policy/validator.rb', line 6 def ==(other) other.is_a?(self.class) && name && other.name == name end |
#check(object) ⇒ Object
10 11 12 |
# File 'lib/tram/policy/validator.rb', line 10 def check(object) name ? object.__send__(name) : object.instance_exec(&block) end |