Class: Vimeo::Base

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/vimeo.rb,
lib/vimeo/base.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.



10
11
12
13
14
15
16
17
18
19
# File 'lib/vimeo/base.rb', line 10

def initialize(options = {})
  @version = options[:version] || "3.2"
  @access_token = options[:access_token]

  @headers = {
    "Content-Type" => "application/json",
    "Accept" => "application/vnd.vimeo.*+json;version=#{@version}"
  }
  @headers["Authorization"] = "bearer #{@access_token}" if @access_token
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



8
9
10
# File 'lib/vimeo/base.rb', line 8

def access_token
  @access_token
end

#versionObject

Returns the value of attribute version.



8
9
10
# File 'lib/vimeo/base.rb', line 8

def version
  @version
end

Instance Method Details

#upload(options) ⇒ Object



8
9
10
# File 'lib/vimeo.rb', line 8

def upload(options)
  post('/me/videos', options)
end