Class: BitsOnTheRun::Store

Inherits:
Base
  • Object
show all
Defined in:
lib/bitsontherun/store.rb

Instance Method Summary collapse

Methods inherited from Base

#method

Constructor Details

#initializeStore

Returns a new instance of Store.



3
4
5
6
7
8
9
# File 'lib/bitsontherun/store.rb', line 3

def initialize
  @response = nil
  @defaults = {
    :api_format => BitsOnTheRun.format
  }
  super
end

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
# File 'lib/bitsontherun/store.rb', line 15

def execute
  build_token
  file = Curl::PostField.file("file", @filename)
  response = Curl::Easy.http_post(build_store_url, file) do |curl|
    curl.multipart_form_post = true
  end.body_str
  Response.new(response)
end

#file(filename) ⇒ Object



11
12
13
# File 'lib/bitsontherun/store.rb', line 11

def file(filename)
  @filename = filename.to_s
end