Class: Lemon::SourceParser::Method
- Inherits:
-
Object
- Object
- Lemon::SourceParser::Method
- Defined in:
- lib/lemon/coverage/source_parser.rb
Overview
A Method can be instance or class level.
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#name ⇒ Object
(also: #to_s)
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, comment = '', args = []) ⇒ Method
constructor
A new instance of Method.
- #inspect ⇒ Object
- #to_sym ⇒ Object
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
#args ⇒ Object
Returns the value of attribute args.
244 245 246 |
# File 'lib/lemon/coverage/source_parser.rb', line 244 def args @args end |
#comment ⇒ Object
Returns the value of attribute comment.
244 245 246 |
# File 'lib/lemon/coverage/source_parser.rb', line 244 def comment @comment end |
#name ⇒ Object 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
#inspect ⇒ Object
257 258 259 |
# File 'lib/lemon/coverage/source_parser.rb', line 257 def inspect "#{name}(#{args.join(', ')})" end |
#to_sym ⇒ Object
253 254 255 |
# File 'lib/lemon/coverage/source_parser.rb', line 253 def to_sym name.to_sym end |