Module: Tweedle

Defined in:
lib/tweedle.rb,
lib/tweedle/client.rb,
lib/tweedle/errors.rb,
lib/tweedle/version.rb,
lib/tweedle/statuses.rb

Overview

Public: The Tweedle namespace.

Defined Under Namespace

Classes: Client, ConnectionError, Statuses

Constant Summary collapse

VERSION =

Public: The current Tweedle version.

"0.1.2"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.configObject

Public: Holds the global Tweedle configuration OpenStruct object.



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

def config
  @config
end

Class Method Details

.configure {|@config| ... } ⇒ Object

Yields the global configuration OpenStruct object to the passed block. Will assign a new OpenStruct object if none has been set.

Examples

Tweedle.configure do |config|
  config.consumer_key    = "the_consumer_key"
  config.consumer_secret = "the_consumer_secret"
  config.oauth_token     = "the_oauth_token"
  config.oauth_secret    = "the_oauth_secret"
end

Returns nothing.

Yields:



34
35
36
37
# File 'lib/tweedle.rb', line 34

def configure
  @config ||= OpenStruct.new
  yield @config if block_given?
end

.new(config = Tweedle.config) ⇒ Object

Initializes a new Tweedle::Client.

config - Options object for the Tweedle client. By default uses

the global Tweedle configuarion (default: Tweedle.config).

Examples

Tweedle.new
# => Tweedle::Client

Tweedle.new(config_object)
# => Tweedle::Client

Returns a Tweedle::Client instance.



53
54
55
# File 'lib/tweedle.rb', line 53

def new(config = Tweedle.config)
  Tweedle::Client.new(config)
end