Class: TomDoc::Method

Inherits:
Object
  • Object
show all
Defined in:
lib/tomdoc/method.rb

Overview

A Method can be instance or class level.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, comment = '', args = []) ⇒ Method

Returns a new instance of Method.



6
7
8
9
10
# File 'lib/tomdoc/method.rb', line 6

def initialize(name, comment = '', args = [])
  @name    = name
  @comment = comment
  @args    = args || []
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



4
5
6
# File 'lib/tomdoc/method.rb', line 4

def args
  @args
end

#commentObject

Returns the value of attribute comment.



4
5
6
# File 'lib/tomdoc/method.rb', line 4

def comment
  @comment
end

#nameObject Also known as: to_s

Returns the value of attribute name.



4
5
6
# File 'lib/tomdoc/method.rb', line 4

def name
  @name
end

Instance Method Details

#inspectObject



17
18
19
# File 'lib/tomdoc/method.rb', line 17

def inspect
  "#{name}(#{args.join(', ')})"
end

#tomdocObject



13
14
15
# File 'lib/tomdoc/method.rb', line 13

def tomdoc
  @tomdoc ||= TomDoc.new(@comment)
end