Class: Nomius::CLI::Parser::FileParser::TXTParser

Inherits:
Object
  • Object
show all
Defined in:
lib/nomius/cli/parser/file_parser/txt_parser.rb

Overview

Parser for TXT files

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_name:) ⇒ TXTParser

Returns a new instance of TXTParser.



17
18
19
# File 'lib/nomius/cli/parser/file_parser/txt_parser.rb', line 17

def initialize(file_name:)
  @file_name = file_name
end

Instance Attribute Details

#file_nameObject (readonly)

Returns the value of attribute file_name.



11
12
13
# File 'lib/nomius/cli/parser/file_parser/txt_parser.rb', line 11

def file_name
  @file_name
end

Class Method Details

.names(file_name:) ⇒ Object



13
14
15
# File 'lib/nomius/cli/parser/file_parser/txt_parser.rb', line 13

def self.names(file_name:)
  new(file_name: file_name).names
end

Instance Method Details

#namesObject



21
22
23
24
25
# File 'lib/nomius/cli/parser/file_parser/txt_parser.rb', line 21

def names
  cleared_names.map do |name|
    Name.new(name: name)
  end
end