Module: Autoini::InlineComment

Included in:
Pair, Section
Defined in:
lib/autoini/inline_comment.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#commentObject

Returns the value of attribute comment.



7
8
9
# File 'lib/autoini/inline_comment.rb', line 7

def comment
  @comment
end

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/autoini/inline_comment.rb', line 3

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#line_comment(text) ⇒ Object



9
10
11
12
# File 'lib/autoini/inline_comment.rb', line 9

def line_comment(text)
  return text unless comment
  "#{text} #{Comment.new(comment).to_s}"
end