Exception: Troupe::ContractViolation
- Inherits:
-
StandardError
- Object
- StandardError
- Troupe::ContractViolation
- Defined in:
- lib/troupe/contract_violation.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#property ⇒ Object
readonly
Returns the value of attribute property.
Instance Method Summary collapse
-
#initialize(context = nil, opts = {}) ⇒ ContractViolation
constructor
A new instance of ContractViolation.
- #message ⇒ Object
Constructor Details
#initialize(context = nil, opts = {}) ⇒ ContractViolation
Returns a new instance of ContractViolation.
5 6 7 8 9 10 |
# File 'lib/troupe/contract_violation.rb', line 5 def initialize(context=nil, opts={}) @context = context @property = opts[:property] @message = opts[:message] super() end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
3 4 5 |
# File 'lib/troupe/contract_violation.rb', line 3 def context @context end |
#property ⇒ Object (readonly)
Returns the value of attribute property.
3 4 5 |
# File 'lib/troupe/contract_violation.rb', line 3 def property @property end |
Instance Method Details
#message ⇒ Object
12 13 14 |
# File 'lib/troupe/contract_violation.rb', line 12 def @message || "Property '#{property}' violated the interactor's contract." end |