Class: Wc::Engine

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Engine

Returns a new instance of Engine.



5
6
7
# File 'lib/wc/engine.rb', line 5

def initialize(options={})
  
end

Class Method Details

.read_from_file(filename) ⇒ Object



9
10
11
# File 'lib/wc/engine.rb', line 9

def self.read_from_file(filename)
  Array(Wc::Reader.read(filename)).sort { |one, two| -(one[1] <=> two[1]) }
end

.read_inline(a_text) ⇒ Object



13
14
15
# File 'lib/wc/engine.rb', line 13

def self.read_inline(a_text)
  Array(Wc::Reader.consume(a_text)).sort { |one, two| -(one[1] <=> two[1]) }
end