Module: Wordy

Defined in:
lib/wordy.rb,
lib/wordy/cli.rb,
lib/wordy/job.rb,
lib/wordy/account.rb

Defined Under Namespace

Classes: Account, Cli, Job, WordyException

Constant Summary collapse

WORDY_URL =
URI.parse('https://wordy.com/api/1.0/')
WORDY_STAGING_URL =
URI.parse('https://staging.wordy.com/api/1.0/')

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

Returns the value of attribute api_key.



11
12
13
# File 'lib/wordy.rb', line 11

def api_key
  @api_key
end

.envObject

Returns the value of attribute env.



11
12
13
# File 'lib/wordy.rb', line 11

def env
  @env
end

.usernameObject

Returns the value of attribute username.



11
12
13
# File 'lib/wordy.rb', line 11

def username
  @username
end

Class Method Details

.configure {|_self| ... } ⇒ Object

In your initializer: Wordy.configure do |c|

c.api_key   = ENV['WORDY_API_KEY']
c.username  = ENV['WORDY_USERNAME']

end

Yields:

  • (_self)

Yield Parameters:

  • _self (Wordy)

    the object that the method was called on



19
20
21
22
# File 'lib/wordy.rb', line 19

def configure
  self.env = 'production'
  yield self
end

.wordy_urlObject



24
25
26
# File 'lib/wordy.rb', line 24

def wordy_url
  self.env == 'production' ? WORDY_URL : WORDY_STAGING_URL
end