Class: JasmineParser::FunctionInvocation

Inherits:
Node
  • Object
show all
Defined in:
lib/jasmine-parser/nodes/function_invocation_node.rb

Instance Attribute Summary

Attributes inherited from Node

#children, #filename, #js_object, #line, #name, #parent

Instance Method Summary collapse

Methods inherited from Node

#clone, function_invocation, group, it, root, shared_behavior_declaration, shared_behavior_invocation

Constructor Details

#initialize(args) ⇒ FunctionInvocation

Returns a new instance of FunctionInvocation.



37
38
39
# File 'lib/jasmine-parser/nodes/function_invocation_node.rb', line 37

def initialize(args)
  super
end

Instance Method Details

#convert_to_shared_behavior_invocationObject

TODO: really really really make some tests for this method



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/jasmine-parser/nodes/function_invocation_node.rb', line 46

def convert_to_shared_behavior_invocation

  args = {
    :name      => name,
    :line      => line,
    :parent    => parent,
    :children  => [],
    :filename  => filename,
    :js_object => js_object
  }

  new_node = Node.shared_behavior_invocation args
  self_index = self.parent.children.index self
  self.parent.children[self_index] = new_node
  self.parent = nil
end

#formatted_nameObject



64
65
66
# File 'lib/jasmine-parser/nodes/function_invocation_node.rb', line 64

def formatted_name
  nil
end

#ready_to_be_adopted?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/jasmine-parser/nodes/function_invocation_node.rb', line 41

def ready_to_be_adopted?
  false
end

#typeObject



33
34
35
# File 'lib/jasmine-parser/nodes/function_invocation_node.rb', line 33

def type
  :function_invocation
end