Class: StyleScanner::SentenceScans::Base

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sentence) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/style_scanner/sentence_scans/base.rb', line 7

def initialize(sentence)
  @sentence = sentence
end

Instance Attribute Details

#sentenceObject (readonly)

Returns the value of attribute sentence.



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

def sentence
  @sentence
end

Class Method Details

.load_file(filename) ⇒ Object



61
62
63
64
# File 'lib/style_scanner/sentence_scans/base.rb', line 61

def load_file(filename)
  file_location = File.expand_path("../../../dictionaries/#{filename}", __FILE__)
  IO.read(file_location).split("\n")
end

.scan(sentence) ⇒ Object



11
12
13
# File 'lib/style_scanner/sentence_scans/base.rb', line 11

def self.scan(sentence)
  new(sentence).scan
end