Class: CanDo::Dsl::Rule
- Inherits:
-
Object
- Object
- CanDo::Dsl::Rule
- Defined in:
- lib/can_do/dsl.rb
Instance Attribute Summary collapse
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
Instance Method Summary collapse
- #call(object, noun) ⇒ Object
-
#initialize(reason, &block) ⇒ Rule
constructor
A new instance of Rule.
Constructor Details
#initialize(reason, &block) ⇒ Rule
Returns a new instance of Rule.
51 52 53 54 |
# File 'lib/can_do/dsl.rb', line 51 def initialize(reason, &block) @reason = reason || "Unknown Reason" @block = block end |
Instance Attribute Details
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
49 50 51 |
# File 'lib/can_do/dsl.rb', line 49 def reason @reason end |
Instance Method Details
#call(object, noun) ⇒ Object
56 57 58 |
# File 'lib/can_do/dsl.rb', line 56 def call(object, noun) @block.call(object) end |