Class: Kintama::Runnable
- Inherits:
-
Object
- Object
- Kintama::Runnable
- Defined in:
- lib/kintama/runnable.rb
Class Attribute Summary collapse
-
.definition ⇒ Object
Returns the value of attribute definition.
-
.name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
-
.full_name ⇒ Object
Returns the full name of this context, taking any parent contexts into account.
- .is_a_context? ⇒ Boolean
- .is_a_test? ⇒ Boolean
- .line_defined ⇒ Object
- .parent ⇒ Object
- .to_s ⇒ Object
Class Attribute Details
.definition ⇒ Object
Returns the value of attribute definition.
4 5 6 |
# File 'lib/kintama/runnable.rb', line 4 def definition @definition end |
.name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/kintama/runnable.rb', line 4 def name @name end |
Class Method Details
.full_name ⇒ Object
Returns the full name of this context, taking any parent contexts into account
24 25 26 27 28 29 30 |
# File 'lib/kintama/runnable.rb', line 24 def full_name if instance_variable_defined?(:@name) && @name [parent ? parent.full_name : nil, @name].compact.join(" ") else nil end end |
.is_a_context? ⇒ Boolean
15 16 17 |
# File 'lib/kintama/runnable.rb', line 15 def is_a_context? !is_a_test? end |
.is_a_test? ⇒ Boolean
10 11 12 13 |
# File 'lib/kintama/runnable.rb', line 10 def is_a_test? ancestors.index(Kintama::Test) && ancestors.index(Kintama::Test) < ancestors.index(Kintama::Context) end |
.line_defined ⇒ Object
32 33 34 |
# File 'lib/kintama/runnable.rb', line 32 def line_defined definition ? definition.last : nil end |
.parent ⇒ Object
19 20 21 |
# File 'lib/kintama/runnable.rb', line 19 def parent superclass.ancestors.include?(Kintama::Context) ? superclass : nil end |
.to_s ⇒ Object
6 7 8 |
# File 'lib/kintama/runnable.rb', line 6 def to_s "<#{is_a_test? ? 'Test' : 'Context'}:#{name}>" end |