Class: GetComments::Code

Inherits:
Object
  • Object
show all
Defined in:
lib/getcomments/code.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(code) ⇒ Code

Returns a new instance of Code.



5
6
7
8
# File 'lib/getcomments/code.rb', line 5

def initialize(code)
  @code = code
  @comment_index = 0
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



3
4
5
# File 'lib/getcomments/code.rb', line 3

def code
  @code
end

#comment_indexObject (readonly)

Returns the value of attribute comment_index.



3
4
5
# File 'lib/getcomments/code.rb', line 3

def comment_index
  @comment_index
end

Instance Method Details

#commentsObject



10
11
12
# File 'lib/getcomments/code.rb', line 10

def comments
  @comments ||= comments!
end