Class: JavaParse::JavaMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/javaparse/java_method.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(clazz, signature, lines_count) ⇒ JavaMethod

Returns a new instance of JavaMethod.



7
8
9
10
11
12
# File 'lib/javaparse/java_method.rb', line 7

def initialize(clazz, signature, lines_count)
  @clazz = clazz
  @signature = signature.delete('{').strip
  @name = @signature.match(/.*\s(.*)\(.*\)/)[1]
  @lines = lines_count
end

Instance Attribute Details

#clazzObject (readonly)

Returns the value of attribute clazz.



5
6
7
# File 'lib/javaparse/java_method.rb', line 5

def clazz
  @clazz
end

#linesObject (readonly)

Returns the value of attribute lines.



5
6
7
# File 'lib/javaparse/java_method.rb', line 5

def lines
  @lines
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/javaparse/java_method.rb', line 5

def name
  @name
end

#signatureObject (readonly)

Returns the value of attribute signature.



5
6
7
# File 'lib/javaparse/java_method.rb', line 5

def signature
  @signature
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/javaparse/java_method.rb', line 14

def to_s
  "#{self.class}, signature=#{signature}, name=#{name}, class=#{clazz}, lines=#{lines}"
end