Class: SlideshareApi::Client
- Inherits:
-
Object
- Object
- SlideshareApi::Client
- Defined in:
- lib/slideshare_api/client.rb
Constant Summary collapse
- SLIDESHARE_API_URL =
'https://www.slideshare.net/api/2'
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#shared_secret ⇒ Object
Returns the value of attribute shared_secret.
Instance Method Summary collapse
-
#initialize(api_key, shared_secret) ⇒ Client
constructor
A new instance of Client.
- #slideshow(options = {}) ⇒ Object
Constructor Details
#initialize(api_key, shared_secret) ⇒ Client
Returns a new instance of Client.
12 13 14 15 16 |
# File 'lib/slideshare_api/client.rb', line 12 def initialize(api_key, shared_secret) @api_key = api_key @shared_secret = shared_secret build_connection end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
10 11 12 |
# File 'lib/slideshare_api/client.rb', line 10 def api_key @api_key end |
#connection ⇒ Object
Returns the value of attribute connection.
10 11 12 |
# File 'lib/slideshare_api/client.rb', line 10 def connection @connection end |
#shared_secret ⇒ Object
Returns the value of attribute shared_secret.
10 11 12 |
# File 'lib/slideshare_api/client.rb', line 10 def shared_secret @shared_secret end |
Instance Method Details
#slideshow(options = {}) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/slideshare_api/client.rb', line 18 def ( = {}) params = {} params.merge!({slideshow_url: [:slideshow_url]}) if [:slideshow_url] params.merge!({slideshow_id: [:slideshow_id]}) if [:slideshow_id] params.merge!({detailed: 1}) if [:detailed] SlideshareApi::Model::Slideshow.new Nokogiri::XML(@connection.get('get_slideshow', api_validation_params.merge(params)).body) end |