Class: HTTPThumbnailerClient::ThumbnailSpec::EditSpec
- Inherits:
-
Object
- Object
- HTTPThumbnailerClient::ThumbnailSpec::EditSpec
- Defined in:
- lib/httpthumbnailer-client/thumbnail_spec.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, args, options = {}) ⇒ EditSpec
constructor
A new instance of EditSpec.
- #to_s ⇒ Object
Constructor Details
#initialize(name, args, options = {}) ⇒ EditSpec
Returns a new instance of EditSpec.
88 89 90 91 92 93 94 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 88 def initialize(name, args, = {}) name.nil? or name.empty? and raise MissingArgumentError, 'edit name' @name = name @args = args = end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
73 74 75 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 73 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
73 74 75 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 73 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
73 74 75 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 73 def end |
Class Method Details
.from_string(string) ⇒ Object
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 75 def self.from_string(string) args = HTTPThumbnailerClient::ThumbnailSpec.split_args(string) args, = HTTPThumbnailerClient::ThumbnailSpec.(args) name = args.shift begin = HTTPThumbnailerClient::ThumbnailSpec.() rescue InvalidFormatError => error raise error.for_edit(name) end new(name, args, ) end |
Instance Method Details
#to_s ⇒ Object
96 97 98 99 100 101 102 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 96 def to_s begin [@name, *@args, *HTTPThumbnailerClient::ThumbnailSpec.()].join(',') rescue InvalidFormatError => error raise error.for_edit(name) end end |