Class: Mushikago::Mitsubachi::ResourceStoreRequest

Inherits:
Http::MultipartPostRequest show all
Defined in:
lib/mushikago/mitsubachi/resource_store_request.rb

Constant Summary

Constants inherited from Http::MultipartRequest

Http::MultipartRequest::CR, Http::MultipartRequest::EOL, Http::MultipartRequest::LF

Instance Attribute Summary

Attributes inherited from Http::Request

#headers, #host, #params, #port

Instance Method Summary collapse

Methods inherited from Http::MultipartPostRequest

#http_method

Methods included from Auth::Signature

#add_signature!, #string_to_sign

Methods inherited from Http::MultipartRequest

#multipart_body, #to_http_request

Methods inherited from Http::Request

#[], #[]=, add_param, #to_http_request, #url_encoded_params

Constructor Details

#initialize(project_name, file_or_file_name, options = {}) ⇒ ResourceStoreRequest

Returns a new instance of ResourceStoreRequest.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/mushikago/mitsubachi/resource_store_request.rb', line 12

def initialize project_name, file_or_file_name, options={}
  super(options)
  self.project_name = project_name
  if(file_or_file_name.kind_of?(File))
    self.file = file_or_file_name
  else
    self.file = File.new(file_or_file_name.to_s)
  end
  self.file_name = options[:file_name] || file.path
  self.content_type = options[:content_type] || MIME::Types.of(file.path).first.to_s
  self.public = options[:public]
end

Instance Method Details

#pathObject



5
# File 'lib/mushikago/mitsubachi/resource_store_request.rb', line 5

def path; '/1/mitsubachi/resource/store' end