Class: RemoteTable::Request

Inherits:
Object
  • Object
show all
Defined in:
lib/remote_table/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bus) ⇒ Request

TODO: support post_data TODO: support HTTP basic auth



7
8
9
# File 'lib/remote_table/request.rb', line 7

def initialize(bus)
  @url = bus[:url] or raise "need url"
end

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/remote_table/request.rb', line 3

def password
  @password
end

#post_dataObject

Returns the value of attribute post_data.



3
4
5
# File 'lib/remote_table/request.rb', line 3

def post_data
  @post_data
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/remote_table/request.rb', line 3

def url
  @url
end

#usernameObject

Returns the value of attribute username.



3
4
5
# File 'lib/remote_table/request.rb', line 3

def username
  @username
end

Instance Method Details

#downloadObject



11
12
13
14
15
# File 'lib/remote_table/request.rb', line 11

def download
  path = ::File.join(staging_dir_path, 'REMOTE_TABLE_PACKAGE')
  `curl --silent \"#{url_with_google_docs_handling}\" > #{path}`
  path
end