Class: Line
- Inherits:
-
Object
- Object
- Line
- Defined in:
- lib/parser.rb
Instance Attribute Summary collapse
-
#about ⇒ Object
Returns the value of attribute about.
-
#hello ⇒ Object
Returns the value of attribute hello.
Instance Method Summary collapse
- #agnostic? ⇒ Boolean
-
#initialize(input) ⇒ Line
constructor
A new instance of Line.
Constructor Details
#initialize(input) ⇒ Line
Returns a new instance of Line.
32 33 34 35 |
# File 'lib/parser.rb', line 32 def initialize(input) @about = input[0..44] @hello = input[45..input.length].lstrip.rstrip << "\n" end |
Instance Attribute Details
#about ⇒ Object
Returns the value of attribute about.
30 31 32 |
# File 'lib/parser.rb', line 30 def about @about end |
#hello ⇒ Object
Returns the value of attribute hello.
30 31 32 |
# File 'lib/parser.rb', line 30 def hello @hello end |
Instance Method Details
#agnostic? ⇒ Boolean
43 44 45 |
# File 'lib/parser.rb', line 43 def agnostic? Hello::KINDS.all? { |kind| ! about.include?(kind) } end |