Class: Acbaker::Processors::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/acbaker/processors/base.rb

Direct Known Subclasses

Center, Constraint, Contain, Cover

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(asset_pack, options = {}) ⇒ Base

Returns a new instance of Base.



10
11
12
13
# File 'lib/acbaker/processors/base.rb', line 10

def initialize(asset_pack, options={})
  @asset_pack = asset_pack
  @options = options ? defaults.merge(options) : defaults
end

Instance Attribute Details

#asset_packObject

Returns the value of attribute asset_pack.



4
5
6
# File 'lib/acbaker/processors/base.rb', line 4

def asset_pack
  @asset_pack
end

#optionsObject

Returns the value of attribute options.



4
5
6
# File 'lib/acbaker/processors/base.rb', line 4

def options
  @options
end

Instance Method Details

#defaultsObject



6
7
8
# File 'lib/acbaker/processors/base.rb', line 6

def defaults
  {}
end

#run(image, image_spec, width = nil, height = nil) ⇒ Object



15
16
17
# File 'lib/acbaker/processors/base.rb', line 15

def run(image, image_spec, width=nil, height=nil)
  throw "Acbaker::Processors::Base should be extended"
end