Class: HTTPThumbnailerClient::ThumbnailSpec::Builder
- Inherits:
-
Object
- Object
- HTTPThumbnailerClient::ThumbnailSpec::Builder
- Defined in:
- lib/httpthumbnailer-client/thumbnail_spec.rb
Instance Attribute Summary collapse
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
- #edit(name, *args) ⇒ Object
- #edit_spec(spec) ⇒ Object
-
#initialize(method, width, height, format = 'jpeg', options = {}, &block) ⇒ Builder
constructor
A new instance of Builder.
- #to_s ⇒ Object
Constructor Details
#initialize(method, width, height, format = 'jpeg', options = {}, &block) ⇒ Builder
Returns a new instance of Builder.
5 6 7 8 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 5 def initialize(method, width, height, format = 'jpeg', = {}, &block) @spec = ThumbnailSpec.new(method, width.to_s, height.to_s, format, ) instance_eval(&block) if block end |
Instance Attribute Details
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
25 26 27 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 25 def spec @spec end |
Instance Method Details
#edit(name, *args) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 10 def edit(name, *args) , args = *args.partition{|e| e.kind_of? Hash} = .each.with_object({}) do |opt, hash| hash.merge! opt end edit_spec ThumbnailSpec::EditSpec.new(name, args, ) self end |
#edit_spec(spec) ⇒ Object
20 21 22 23 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 20 def edit_spec(spec) @spec.edits << spec self end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/httpthumbnailer-client/thumbnail_spec.rb', line 27 def to_s @spec.to_s end |