Module: Wsnaps
- Extended by:
- Forwardable
- Defined in:
- lib/wsnaps.rb
Class Attribute Summary collapse
- .api_tocken ⇒ Object
-
.connection_options ⇒ Object
Returns the value of attribute connection_options.
-
.consumer_key ⇒ Object
writeonly
Sets the attribute consumer_key.
-
.consumer_secret ⇒ Object
writeonly
Sets the attribute consumer_secret.
-
.endpoint ⇒ Object
Returns the value of attribute endpoint.
-
.identity_map ⇒ Object
Returns the value of attribute identity_map.
-
.middleware ⇒ Object
Returns the value of attribute middleware.
-
.oauth_token ⇒ Object
writeonly
Sets the attribute oauth_token.
-
.oauth_token_secret ⇒ Object
writeonly
Sets the attribute oauth_token_secret.
Class Method Summary collapse
- .client ⇒ Object
- .configure {|_self| ... } ⇒ Object
- .keys ⇒ Object
- .method_missing(method_name, *args, &block) ⇒ Object
- .oauth_credentials ⇒ Object
- .reset! ⇒ Object (also: setup)
- .snap ⇒ Object
Instance Method Summary collapse
- #respond_to?(method_name, include_private = false) ⇒ Boolean
- #respond_to_missing?(method_name, include_private = false) ⇒ Boolean
Class Attribute Details
.api_tocken ⇒ Object
41 42 43 |
# File 'lib/wsnaps.rb', line 41 def api_tocken @api_tocken end |
.connection_options ⇒ Object
Returns the value of attribute connection_options.
11 12 13 |
# File 'lib/wsnaps.rb', line 11 def @connection_options end |
.consumer_key=(value) ⇒ Object (writeonly)
Sets the attribute consumer_key
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
10 11 12 |
# File 'lib/wsnaps.rb', line 10 def consumer_secret=(value) @consumer_secret = value end |
.endpoint ⇒ Object
Returns the value of attribute endpoint.
11 12 13 |
# File 'lib/wsnaps.rb', line 11 def endpoint @endpoint end |
.identity_map ⇒ Object
Returns the value of attribute identity_map.
11 12 13 |
# File 'lib/wsnaps.rb', line 11 def identity_map @identity_map end |
.middleware ⇒ Object
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
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
10 11 12 |
# File 'lib/wsnaps.rb', line 10 def oauth_token_secret=(value) @oauth_token_secret = value end |
Class Method Details
.client ⇒ Object
58 59 60 |
# File 'lib/wsnaps.rb', line 58 def client @client ||= WorkSnaps::Client.new end |
.configure {|_self| ... } ⇒ Object
45 46 47 48 |
# File 'lib/wsnaps.rb', line 45 def configure yield self self end |
.keys ⇒ Object
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_credentials ⇒ Object
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.[key]) end self end |
.snap ⇒ Object
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
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
62 |
# File 'lib/wsnaps.rb', line 62 def respond_to_missing?(method_name, include_private=false); client.respond_to?(method_name, include_private); end |