Class: Oktest::TopicNode

Inherits:
Node show all
Defined in:
lib/oktest.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#context_class, #fixtures, #hooks, #parent, #tag

Instance Method Summary collapse

Methods inherited from Node

#_repr, #add_child, #clear_children, #each_child, #get_fixture_block, #get_hook_block, #has_child?, #new_context_object, #register_fixture_block, #register_hook_block, #remove_child_at, #unlink_parent

Methods inherited from Item

#_repr, #unlink_parent

Constructor Details

#initialize(parent, target, tag: nil) ⇒ TopicNode

Returns a new instance of TopicNode.



1120
1121
1122
1123
# File 'lib/oktest.rb', line 1120

def initialize(parent, target, tag: nil)
  super(parent, tag: tag)
  @target = target
end

Instance Attribute Details

#_prefixObject



1135
1136
1137
# File 'lib/oktest.rb', line 1135

def _prefix
  @_prefix || '*'
end

#targetObject (readonly)

Returns the value of attribute target.



1125
1126
1127
# File 'lib/oktest.rb', line 1125

def target
  @target
end

Instance Method Details

#+@Object



1146
1147
1148
1149
# File 'lib/oktest.rb', line 1146

def +@
  #; [!tzorv] returns self.
  self
end

#accept_visitor(visitor, *args) ⇒ Object



1141
1142
1143
1144
# File 'lib/oktest.rb', line 1141

def accept_visitor(visitor, *args)
  #; [!c1b33] invokes 'visit_topic()' method of visitor and returns result of it.
  return visitor.visit_topic(self, *args)
end

#run_block_in_context_class(&block) ⇒ Object



1128
1129
1130
1131
1132
1133
# File 'lib/oktest.rb', line 1128

def run_block_in_context_class(&block)
  #; [!i2kvj] run block in context class.
  #; [!pr3vj] run block with topic target as an argument.
  target = @target
  @context_class.class_exec(target, &block)
end

#topic?Boolean

Returns:

  • (Boolean)


1139
# File 'lib/oktest.rb', line 1139

def topic?; true; end