Class: Line

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#aboutObject

Returns the value of attribute about.



30
31
32
# File 'lib/parser.rb', line 30

def about
  @about
end

#helloObject

Returns the value of attribute hello.



30
31
32
# File 'lib/parser.rb', line 30

def hello
  @hello
end

Instance Method Details

#agnostic?Boolean

Returns:

  • (Boolean)


43
44
45
# File 'lib/parser.rb', line 43

def agnostic?
  Hello::KINDS.all? { |kind| ! about.include?(kind) }
end