Class: SandiMeter::Method
- Inherits:
-
Object
- Object
- SandiMeter::Method
- Defined in:
- lib/sandi_meter/sandi_meter/method.rb
Constant Summary collapse
- MAX_LOC =
5
Instance Attribute Summary collapse
-
#first_line ⇒ Object
Returns the value of attribute first_line.
-
#ivars ⇒ Object
Returns the value of attribute ivars.
-
#last_line ⇒ Object
Returns the value of attribute last_line.
-
#misindented ⇒ Object
Returns the value of attribute misindented.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number_of_arguments ⇒ Object
Returns the value of attribute number_of_arguments.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Method
constructor
A new instance of Method.
- #misindented? ⇒ Boolean
- #size ⇒ Object
- #small? ⇒ Boolean
Constructor Details
#initialize(params = {}) ⇒ Method
Returns a new instance of Method.
7 8 9 10 11 12 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 7 def initialize(params = {}) params.each do |key, value| instance_variable_set("@#{key}", value) end @ivars = [] end |
Instance Attribute Details
#first_line ⇒ Object
Returns the value of attribute first_line.
5 6 7 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 5 def first_line @first_line end |
#ivars ⇒ Object
Returns the value of attribute ivars.
5 6 7 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 5 def ivars @ivars end |
#last_line ⇒ Object
Returns the value of attribute last_line.
5 6 7 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 5 def last_line @last_line end |
#misindented ⇒ Object
Returns the value of attribute misindented.
5 6 7 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 5 def misindented @misindented end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 5 def name @name end |
#number_of_arguments ⇒ Object
Returns the value of attribute number_of_arguments.
5 6 7 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 5 def number_of_arguments @number_of_arguments end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 5 def path @path end |
Instance Method Details
#misindented? ⇒ Boolean
18 19 20 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 18 def misindented? !(@last_line) end |
#size ⇒ Object
14 15 16 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 14 def size @last_line - @first_line - 1 if @last_line end |
#small? ⇒ Boolean
22 23 24 |
# File 'lib/sandi_meter/sandi_meter/method.rb', line 22 def small? size <= MAX_LOC if @last_line end |