Class: Nydp::Fn

Inherits:
Proc show all
Defined in:
lib/nydp/interpreted_function.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&b) ⇒ Fn

Returns a new instance of Fn.



8
9
10
# File 'lib/nydp/interpreted_function.rb', line 8

def initialize &b
  super &b
end

Instance Attribute Details

#srcObject

Returns the value of attribute src.



7
8
9
# File 'lib/nydp/interpreted_function.rb', line 7

def src
  @src
end

Instance Method Details

#container_class_nameObject



14
15
16
17
# File 'lib/nydp/interpreted_function.rb', line 14

def container_class_name
  file, line = source_location
  [file.split(/\//).last, line].join(":")
end

#inspectObject



18
19
20
# File 'lib/nydp/interpreted_function.rb', line 18

def inspect
  [@name, Nydp.nydp_from_backtrace(source_location.join(":"))].compact.join(" : ")
end

#is_named(name) ⇒ Object



28
29
30
# File 'lib/nydp/interpreted_function.rb', line 28

def is_named name
  @name = name
end

#nydp_typeObject



24
25
26
# File 'lib/nydp/interpreted_function.rb', line 24

def nydp_type
  :fn
end

#to_sObject



11
12
13
# File 'lib/nydp/interpreted_function.rb', line 11

def to_s
  Nydp.nydp_from_backtrace(source_location.join(":"))
end