Class: Flickr::MultiPartForm
- Inherits:
-
Object
- Object
- Flickr::MultiPartForm
- Defined in:
- lib/flickr/upload.rb
Instance Attribute Summary collapse
-
#boundary ⇒ Object
Returns the value of attribute boundary.
-
#parts ⇒ Object
Returns the value of attribute parts.
Instance Method Summary collapse
-
#initialize(boundary = nil) ⇒ MultiPartForm
constructor
A new instance of MultiPartForm.
- #to_s ⇒ Object
Constructor Details
#initialize(boundary = nil) ⇒ MultiPartForm
Returns a new instance of MultiPartForm.
48 49 50 51 52 |
# File 'lib/flickr/upload.rb', line 48 def initialize(boundary=nil) @boundary = boundary || "----------------------------Ruby#{rand(1000000000000)}" @parts = [] end |
Instance Attribute Details
#boundary ⇒ Object
Returns the value of attribute boundary.
46 47 48 |
# File 'lib/flickr/upload.rb', line 46 def boundary @boundary end |
#parts ⇒ Object
Returns the value of attribute parts.
46 47 48 |
# File 'lib/flickr/upload.rb', line 46 def parts @parts end |
Instance Method Details
#to_s ⇒ Object
54 55 56 57 |
# File 'lib/flickr/upload.rb', line 54 def to_s "--#@boundary\r\n" + parts.map{|p| p.to_s}.join("\r\n--#@boundary\r\n") + "\r\n--#@boundary--\r\n" end |