Class: Webspicy::Web::Specification::FileUpload
- Inherits:
-
Object
- Object
- Webspicy::Web::Specification::FileUpload
- Defined in:
- lib/webspicy/web/specification/file_upload.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#param_name ⇒ Object
readonly
Returns the value of attribute param_name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(raw) ⇒ FileUpload
constructor
A new instance of FileUpload.
- #locate(specification) ⇒ Object
- #to_info ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(raw) ⇒ FileUpload
Returns a new instance of FileUpload.
6 7 8 9 10 |
# File 'lib/webspicy/web/specification/file_upload.rb', line 6 def initialize(raw) @path = raw[:path] @content_type = raw[:content_type] @param_name = raw[:param_name] || "file" end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
12 13 14 |
# File 'lib/webspicy/web/specification/file_upload.rb', line 12 def content_type @content_type end |
#param_name ⇒ Object (readonly)
Returns the value of attribute param_name.
12 13 14 |
# File 'lib/webspicy/web/specification/file_upload.rb', line 12 def param_name @param_name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/webspicy/web/specification/file_upload.rb', line 12 def path @path end |
Class Method Details
.info(raw) ⇒ Object
14 15 16 |
# File 'lib/webspicy/web/specification/file_upload.rb', line 14 def self.info(raw) new(raw) end |
Instance Method Details
#locate(specification) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/webspicy/web/specification/file_upload.rb', line 18 def locate(specification) FileUpload.new({ path: specification.locate(path), content_type: content_type, param_name: param_name }) end |
#to_info ⇒ Object
26 27 28 29 30 |
# File 'lib/webspicy/web/specification/file_upload.rb', line 26 def to_info { path: path.to_s, content_type: content_type, param_name: param_name } end |
#to_s ⇒ Object Also known as: inspect
32 33 34 |
# File 'lib/webspicy/web/specification/file_upload.rb', line 32 def to_s "FileUpload(#{to_info})" end |