Class: OpenKit::Request::Upload
- Inherits:
-
Object
- Object
- OpenKit::Request::Upload
- Defined in:
- lib/openkit/request/upload.rb
Instance Attribute Summary collapse
-
#filepath ⇒ Object
Returns the value of attribute filepath.
-
#param_name ⇒ Object
Returns the value of attribute param_name.
Instance Method Summary collapse
- #close ⇒ Object
- #file ⇒ Object
-
#initialize(param_name, filepath) ⇒ Upload
constructor
A new instance of Upload.
Constructor Details
#initialize(param_name, filepath) ⇒ Upload
Returns a new instance of Upload.
7 8 9 10 |
# File 'lib/openkit/request/upload.rb', line 7 def initialize(param_name, filepath) @param_name = param_name @filepath = filepath end |
Instance Attribute Details
#filepath ⇒ Object
Returns the value of attribute filepath.
5 6 7 |
# File 'lib/openkit/request/upload.rb', line 5 def filepath @filepath end |
#param_name ⇒ Object
Returns the value of attribute param_name.
5 6 7 |
# File 'lib/openkit/request/upload.rb', line 5 def param_name @param_name end |
Instance Method Details
#close ⇒ Object
16 17 18 |
# File 'lib/openkit/request/upload.rb', line 16 def close @file.close if @file # Use ivar directly, not the #file method. end |
#file ⇒ Object
12 13 14 |
# File 'lib/openkit/request/upload.rb', line 12 def file @file ||= File.open(@filepath) end |