Class: Fiveruns::Dash::Store::HTTP::Multipart

Inherits:
Object
  • Object
show all
Defined in:
lib/fiveruns/dash/store/http.rb

Constant Summary collapse

BOUNDARY_ROOT =
'B0UND'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, params = {}) ⇒ Multipart

Returns a new instance of Multipart.



136
137
138
139
# File 'lib/fiveruns/dash/store/http.rb', line 136

def initialize(file, params={})
  @file = file
  @params = params
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



135
136
137
# File 'lib/fiveruns/dash/store/http.rb', line 135

def file
  @file
end

#paramsObject (readonly)

Returns the value of attribute params.



135
136
137
# File 'lib/fiveruns/dash/store/http.rb', line 135

def params
  @params
end

Instance Method Details

#content_typeObject



141
142
143
# File 'lib/fiveruns/dash/store/http.rb', line 141

def content_type
  %(multipart/form-data, boundary="#{boundary}")
end

#to_sObject



145
146
147
# File 'lib/fiveruns/dash/store/http.rb', line 145

def to_s
  %(#{parts}\r\n#{separator}--)
end