Class: Aef::Hosts::Comment
- Defined in:
- lib/hosts/aef/hosts/comment.rb
Overview
Represents a comment-only line as element of a hosts file
Instance Attribute Summary collapse
-
#comment ⇒ String
The comment.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(comment, options = {}) ⇒ Comment
constructor
Initializes a comment.
-
#inspect ⇒ String
A String representation for debugging purposes.
Methods inherited from Element
#cache_filled?, #invalidate_cache!, #to_s
Constructor Details
#initialize(comment, options = {}) ⇒ Comment
Initializes a comment
38 39 40 41 42 43 44 45 |
# File 'lib/hosts/aef/hosts/comment.rb', line 38 def initialize(comment, = {}) (, :cache) raise ArgumentError, 'Comment cannot be empty' unless comment @comment = comment.to_s @cache = [:cache].to_s unless [:cache].nil? end |
Instance Attribute Details
#comment ⇒ String
The comment
31 32 33 |
# File 'lib/hosts/aef/hosts/comment.rb', line 31 def comment @comment end |
Instance Method Details
#inspect ⇒ String
A String representation for debugging purposes
57 58 59 |
# File 'lib/hosts/aef/hosts/comment.rb', line 57 def inspect generate_inspect(self, :comment, :cache) end |