Class: MiniMagick::CommandBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/mini_magick.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeCommandBuilder

Returns a new instance of CommandBuilder.



229
230
231
# File 'lib/mini_magick.rb', line 229

def initialize
  @args = []
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args) ⇒ Object



233
234
235
236
# File 'lib/mini_magick.rb', line 233

def method_missing(symbol, *args)
  @args << "-#{symbol.to_s.gsub('_','-')}"
  @args += args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



227
228
229
# File 'lib/mini_magick.rb', line 227

def args
  @args
end

Instance Method Details

#+(value) ⇒ Object



238
239
240
# File 'lib/mini_magick.rb', line 238

def +(value)
  @args << "+#{value}"
end