Module: Wsnaps

Extended by:
Forwardable
Defined in:
lib/wsnaps.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.api_tockenObject



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

def api_tocken
  @api_tocken
end

.connection_optionsObject

Returns the value of attribute connection_options.



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

def connection_options
  @connection_options
end

.consumer_key=(value) ⇒ Object (writeonly)

Sets the attribute consumer_key

Parameters:

  • value

    the value to set the attribute consumer_key to.



10
11
12
# File 'lib/wsnaps.rb', line 10

def consumer_key=(value)
  @consumer_key = value
end

.consumer_secret=(value) ⇒ Object (writeonly)

Sets the attribute consumer_secret

Parameters:

  • value

    the value to set the attribute consumer_secret to.



10
11
12
# File 'lib/wsnaps.rb', line 10

def consumer_secret=(value)
  @consumer_secret = value
end

.endpointObject

Returns the value of attribute endpoint.



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

def endpoint
  @endpoint
end

.identity_mapObject

Returns the value of attribute identity_map.



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

def identity_map
  @identity_map
end

.middlewareObject

Returns the value of attribute middleware.



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

def middleware
  @middleware
end

.oauth_token=(value) ⇒ Object (writeonly)

Sets the attribute oauth_token

Parameters:

  • value

    the value to set the attribute oauth_token to.



10
11
12
# File 'lib/wsnaps.rb', line 10

def oauth_token=(value)
  @oauth_token = value
end

.oauth_token_secret=(value) ⇒ Object (writeonly)

Sets the attribute oauth_token_secret

Parameters:

  • value

    the value to set the attribute oauth_token_secret to.



10
11
12
# File 'lib/wsnaps.rb', line 10

def oauth_token_secret=(value)
  @oauth_token_secret = value
end

Class Method Details

.clientObject



58
59
60
# File 'lib/wsnaps.rb', line 58

def client
  @client ||= WorkSnaps::Client.new
end

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

Yields:

  • (_self)

Yield Parameters:

  • _self (Wsnaps)

    the object that the method was called on



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

def configure
  yield self
  self
end

.keysObject



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/wsnaps.rb', line 18

def keys
  @keys ||= [
    :api_tocken,
    :consumer_key,
    :consumer_secret,
    :oauth_token,
    :oauth_token_secret,
    :endpoint,
    :connection_options,
    :identity_map,
    :middleware,
  ]
end

.method_missing(method_name, *args, &block) ⇒ Object



65
66
67
68
# File 'lib/wsnaps.rb', line 65

def method_missing(method_name, *args, &block)
  return super unless client.respond_to?(method_name)
  client.send(method_name, *args, &block)
end

.oauth_credentialsObject



32
33
34
35
36
37
38
39
# File 'lib/wsnaps.rb', line 32

def oauth_credentials
  {
    :consumer_key => @consumer_key,
    :consumer_secret => @consumer_secret,
    :token => @oauth_token,
    :token_secret => @oauth_token_secret,
  }
end

.reset!Object Also known as: setup



50
51
52
53
54
55
# File 'lib/wsnaps.rb', line 50

def reset!
  keys.each do |key|
    instance_variable_set(:"@#{key}", WorkSnaps::Default.options[key])
  end
  self
end

.snapObject



14
15
16
# File 'lib/wsnaps.rb', line 14

def snap
  puts "-- snap --"
end

Instance Method Details

#respond_to?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


63
# File 'lib/wsnaps.rb', line 63

def respond_to?(method_name, include_private=false); client.respond_to?(method_name, include_private) || super; end

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


62
# File 'lib/wsnaps.rb', line 62

def respond_to_missing?(method_name, include_private=false); client.respond_to?(method_name, include_private); end