Class: StyleScanner::Scanner

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, options = {}) ⇒ Scanner

Returns a new instance of Scanner.



7
8
9
10
11
12
# File 'lib/style_scanner/scanner.rb', line 7

def initialize(input, options={})
  # remove html
  @options = options
  @input_text = convert_to_txt(input) 
  @sentences = split_into_sentences
end

Instance Attribute Details

#finished_textObject

Returns the value of attribute finished_text.



5
6
7
# File 'lib/style_scanner/scanner.rb', line 5

def finished_text
  @finished_text
end

#input_textObject (readonly)

Returns the value of attribute input_text.



4
5
6
# File 'lib/style_scanner/scanner.rb', line 4

def input_text
  @input_text
end

#optionsObject (readonly)

Returns the value of attribute options.



4
5
6
# File 'lib/style_scanner/scanner.rb', line 4

def options
  @options
end

#sentencesObject (readonly)

Returns the value of attribute sentences.



4
5
6
# File 'lib/style_scanner/scanner.rb', line 4

def sentences
  @sentences
end

Instance Method Details

#scanObject



14
15
16
17
18
19
20
21
# File 'lib/style_scanner/scanner.rb', line 14

def scan 
  sentences.each do |sentence|
    desired_scans.each do |scanner_type|
      scanner_type.scan(sentence)
    end
     puts sentence.user_friendly_readout 
  end
end