Class: Clickmeetings::Open::FileLibrary

Inherits:
Model
  • Object
show all
Defined in:
lib/clickmeetings/models/open/file_library.rb

Instance Attribute Summary collapse

Attributes inherited from Model

#id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Model

api_key, client_options, #default_headers, ping, with_account

Methods inherited from Model

#action_path, all, #client, client_options, #default_headers, #default_params, #destroy, find, #handle_response, #remote_path, #remote_url, set_resource_name, #update

Instance Attribute Details

#conversion_progressObject

Returns the value of attribute conversion_progress.



6
7
8
# File 'lib/clickmeetings/models/open/file_library.rb', line 6

def conversion_progress
  @conversion_progress
end

#document_typeObject

Returns the value of attribute document_type.



6
7
8
# File 'lib/clickmeetings/models/open/file_library.rb', line 6

def document_type
  @document_type
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/clickmeetings/models/open/file_library.rb', line 6

def name
  @name
end

#statusObject

Returns the value of attribute status.



6
7
8
# File 'lib/clickmeetings/models/open/file_library.rb', line 6

def status
  @status
end

#status_messageObject

Returns the value of attribute status_message.



6
7
8
# File 'lib/clickmeetings/models/open/file_library.rb', line 6

def status_message
  @status_message
end

#upload_dateObject

Returns the value of attribute upload_date.



6
7
8
# File 'lib/clickmeetings/models/open/file_library.rb', line 6

def upload_date
  @upload_date
end

#urlObject

Returns the value of attribute url.



6
7
8
# File 'lib/clickmeetings/models/open/file_library.rb', line 6

def url
  @url
end

Class Method Details

.create(path: '', conference_id: nil) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/clickmeetings/models/open/file_library.rb', line 10

def create(path: '', conference_id: nil)
  params = { uploaded: Faraday::UploadIO.new(path, '') }
  if conference_id.present?
    response = Clickmeetings.with_client(client_options) do
      Clickmeetings.client.post remote_url("conferences/#{conference_id}"),
        params.merge(default_params), default_headers
    end
    handle_response response
  else
    super(params)
  end
end

.for_conference(conference_id: nil) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/clickmeetings/models/open/file_library.rb', line 23

def for_conference(conference_id: nil)
  response = Clickmeetings.with_client(client_options) do
    Clickmeetings.client.get remote_url("conferences/#{conference_id}"),
      default_params, default_headers
  end
  handle_response response
end

Instance Method Details

#downloadObject

returns content of file; use File#write to save it



33
34
35
36
37
38
39
40
# File 'lib/clickmeetings/models/open/file_library.rb', line 33

def download
  response = Clickmeetings.with_client(client_options) do
    Clickmeetings.client.connect.get remote_url(__method__, id: id) do |req|
      req.headers.merge! default_headers
    end
  end
  response.body
end