class TextRazor::Sentence
Attributes
position[R]
words[R]
Public Class Methods
create_from_hash(params)
click to toggle source
# File lib/textrazor/sentence.rb, line 18 def self.create_from_hash(params) new(params) end
new(params)
click to toggle source
# File lib/textrazor/sentence.rb, line 7 def initialize(params) @position = params[:position] @words = params[:words].map do |word_hash| Word.create_from_hash(word_hash) end end
Public Instance Methods
number_of_words()
click to toggle source
# File lib/textrazor/sentence.rb, line 14 def number_of_words @words.size end