Class: RestMyCase::Trial::Case
- Inherits:
-
Object
- Object
- RestMyCase::Trial::Case
- Defined in:
- lib/rest_my_case/trial/case.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#defendant ⇒ Object
readonly
Returns the value of attribute defendant.
-
#defendant_class ⇒ Object
readonly
Returns the value of attribute defendant_class.
-
#last_ancestor ⇒ Object
readonly
Returns the value of attribute last_ancestor.
-
#should_abort ⇒ Object
Returns the value of attribute should_abort.
-
#use_cases ⇒ Object
Returns the value of attribute use_cases.
Instance Method Summary collapse
- #aborted ⇒ Object
-
#initialize(last_ancestor, use_case_classes, attributes) ⇒ Case
constructor
A new instance of Case.
Constructor Details
#initialize(last_ancestor, use_case_classes, attributes) ⇒ Case
10 11 12 13 14 15 |
# File 'lib/rest_my_case/trial/case.rb', line 10 def initialize(last_ancestor, use_case_classes, attributes) @context = build_context attributes @last_ancestor = last_ancestor @defendant_class = build_defendant(last_ancestor, use_case_classes) @defendant = @defendant_class.new @context end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
8 9 10 |
# File 'lib/rest_my_case/trial/case.rb', line 8 def context @context end |
#defendant ⇒ Object (readonly)
Returns the value of attribute defendant.
8 9 10 |
# File 'lib/rest_my_case/trial/case.rb', line 8 def defendant @defendant end |
#defendant_class ⇒ Object (readonly)
Returns the value of attribute defendant_class.
8 9 10 |
# File 'lib/rest_my_case/trial/case.rb', line 8 def defendant_class @defendant_class end |
#last_ancestor ⇒ Object (readonly)
Returns the value of attribute last_ancestor.
8 9 10 |
# File 'lib/rest_my_case/trial/case.rb', line 8 def last_ancestor @last_ancestor end |
#should_abort ⇒ Object
Returns the value of attribute should_abort.
6 7 8 |
# File 'lib/rest_my_case/trial/case.rb', line 6 def should_abort @should_abort end |
#use_cases ⇒ Object
Returns the value of attribute use_cases.
6 7 8 |
# File 'lib/rest_my_case/trial/case.rb', line 6 def use_cases @use_cases end |
Instance Method Details
#aborted ⇒ Object
17 18 19 |
# File 'lib/rest_my_case/trial/case.rb', line 17 def aborted @should_abort || defendant.[:should_abort] end |