Module: Wordchuck

Defined in:
lib/wordchuck/client.rb,
lib/wordchuck.rb,
lib/wordchuck/chucker.rb,
lib/wordchuck/railtie.rb,
lib/wordchuck/configuration.rb

Overview

Copyright © Wordchuck Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Defined Under Namespace

Classes: Chucker, Client, Configuration, Error, Railtie

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configurationObject

Wordchuck Configuraton

Call the configure method within a application configuration initializer to set your project key (and other goodies):

Wordchuck.configure do |chuck|
  chuck.project_key = 'from.wordhuck.com.members.area'
  chuck.quiet = true
end


36
37
38
# File 'lib/wordchuck.rb', line 36

def configuration
  @configuration
end

Class Method Details

.api_failureObject



49
50
51
# File 'lib/wordchuck.rb', line 49

def api_failure
  "There was an unexpected API response code. Not HTTP 200. Failed."
end

.configure {|configuration| ... } ⇒ Object

Yields:



37
38
39
40
# File 'lib/wordchuck.rb', line 37

def configure
  self.configuration ||= Configuration.new
  yield(configuration)
end

.has_project_key?Boolean

Returns:

  • (Boolean)


41
42
43
44
# File 'lib/wordchuck.rb', line 41

def has_project_key?
  self.configuration ||= Configuration.new
  configuration.has_project_key?
end

.no_project_keyObject



46
47
48
# File 'lib/wordchuck.rb', line 46

def no_project_key
  "No project key configured. A project key is needed to identify the project in question with the Wordchuck API."
end