Class: MorningPages::Stats

Inherits:
Struct
  • Object
show all
Defined in:
lib/morning-pages/stats.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#wordsObject

Returns the value of attribute words

Returns:

  • (Object)

    the current value of words



2
3
4
# File 'lib/morning-pages/stats.rb', line 2

def words
  @words
end

Instance Method Details

#average_lengthObject



7
8
9
# File 'lib/morning-pages/stats.rb', line 7

def average_length
  words.average_length
end

#countObject



3
4
5
# File 'lib/morning-pages/stats.rb', line 3

def count
  words.count
end

#post!(config) ⇒ Object



11
12
13
# File 'lib/morning-pages/stats.rb', line 11

def post!(config)
  config.post_stats!(:count => count, :average_length => average_length)
end