Class: Lemon::SourceParser::Method

Inherits:
Object
  • Object
show all
Defined in:
lib/lemon/coverage/source_parser.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.



246
247
248
249
250
# File 'lib/lemon/coverage/source_parser.rb', line 246

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

Instance Attribute Details

#argsObject

Returns the value of attribute args.



244
245
246
# File 'lib/lemon/coverage/source_parser.rb', line 244

def args
  @args
end

#commentObject

Returns the value of attribute comment.



244
245
246
# File 'lib/lemon/coverage/source_parser.rb', line 244

def comment
  @comment
end

#nameObject Also known as: to_s

Returns the value of attribute name.



244
245
246
# File 'lib/lemon/coverage/source_parser.rb', line 244

def name
  @name
end

Instance Method Details

#inspectObject



257
258
259
# File 'lib/lemon/coverage/source_parser.rb', line 257

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

#to_symObject



253
254
255
# File 'lib/lemon/coverage/source_parser.rb', line 253

def to_sym
  name.to_sym
end