Class: Rabbit::Task::SlideShare
- Inherits:
-
Object
- Object
- Rabbit::Task::SlideShare
- Includes:
- GetText
- Defined in:
- lib/rabbit/slideshare.rb
Defined Under Namespace
Classes: Error
Constant Summary collapse
- BASE_URL =
"https://www.slideshare.net"
- API_PATH_PREFIX =
"/api/2"
- API_KEY =
"NB1B0IzS"
- SHARED_SECRET =
"iuTFlPzU"
Constants included from GetText
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#pdf_path ⇒ Object
Returns the value of attribute pdf_path.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#title ⇒ Object
Returns the value of attribute title.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(logger) ⇒ SlideShare
constructor
A new instance of SlideShare.
- #upload ⇒ Object
Methods included from GetText
Constructor Details
#initialize(logger) ⇒ SlideShare
Returns a new instance of SlideShare.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/rabbit/slideshare.rb', line 40 def initialize(logger) @logger = logger @user = nil @pdf_path = nil @id = nil @title = nil @description = nil @tags = [] @connection = Faraday.new(:url => BASE_URL) do |builder| builder.request :multipart builder.request :url_encoded builder.response :logger, @logger builder.adapter :net_http end end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
39 40 41 |
# File 'lib/rabbit/slideshare.rb', line 39 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
39 40 41 |
# File 'lib/rabbit/slideshare.rb', line 39 def id @id end |
#pdf_path ⇒ Object
Returns the value of attribute pdf_path.
39 40 41 |
# File 'lib/rabbit/slideshare.rb', line 39 def pdf_path @pdf_path end |
#tags ⇒ Object
Returns the value of attribute tags.
39 40 41 |
# File 'lib/rabbit/slideshare.rb', line 39 def @tags end |
#title ⇒ Object
Returns the value of attribute title.
39 40 41 |
# File 'lib/rabbit/slideshare.rb', line 39 def title @title end |
#user ⇒ Object
Returns the value of attribute user.
39 40 41 |
# File 'lib/rabbit/slideshare.rb', line 39 def user @user end |
Instance Method Details
#upload ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/rabbit/slideshare.rb', line 56 def upload = nil begin = rescue Error @logger.error(_("Feailed to upload: %s") % $!.) return nil end begin edit_title() rescue Error @logger.error(_("Feailed to edit title: %s") % $!.) return nil end url = nil begin url = () rescue Error @logger.error(_("Feailed to get slide URL: %s") % $!.) return nil end url end |