Class: Stenographer::Word
- Inherits:
-
Object
- Object
- Stenographer::Word
- Defined in:
- lib/stenographer/word.rb
Constant Summary collapse
- SWEARWORDS =
File.read('./config/swearwords.txt').split(' ')
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(text) ⇒ Word
constructor
A new instance of Word.
Constructor Details
#initialize(text) ⇒ Word
Returns a new instance of Word.
8 9 10 |
# File 'lib/stenographer/word.rb', line 8 def initialize(text) @text = text end |
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
6 7 8 |
# File 'lib/stenographer/word.rb', line 6 def text @text end |
Class Method Details
.split_message(message) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/stenographer/word.rb', line 12 def self.() words = .body.split(" ") words = words.map(&:strip) words.collect{|text| new(text)} end |