Class: Gslide::Models::Editor
- Includes:
- Concerns::Requests
- Defined in:
- lib/gslide/models/editor.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token) ⇒ Editor
constructor
A new instance of Editor.
-
#insert_presentation(options = {}) ⇒ Gslide::Models::Presentation
Presentation id.
Methods included from Concerns::Requests
Constructor Details
#initialize(token) ⇒ Editor
Returns a new instance of Editor.
11 12 13 14 15 16 17 |
# File 'lib/gslide/models/editor.rb', line 11 def initialize(token) if token.to_s.empty? raise ArgumentError.new("Auth Token must be present") end @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
9 10 11 |
# File 'lib/gslide/models/editor.rb', line 9 def token @token end |
Instance Method Details
#insert_presentation(options = {}) ⇒ Gslide::Models::Presentation
Returns presentation id.
22 23 24 25 26 27 28 |
# File 'lib/gslide/models/editor.rb', line 22 def insert_presentation( = {}) uri = URI(GOOGLE_SLIDES + "") # "title" is the only allowed field in the request body response_body = post_request(uri, auth_token: @token, body: .to_json) Presentation.new response_body["presentationId"], auth: self end |