Class: IconGenerator::Builder
- Inherits:
-
Object
- Object
- IconGenerator::Builder
- Includes:
- Validator
- Defined in:
- lib/icon_generator/builder.rb
Instance Method Summary collapse
-
#build(type) ⇒ Object
Requests a build of the given image type.
-
#build_single ⇒ Object
Builds a single touch icon.
-
#initialize(source, destination) ⇒ Builder
constructor
Sets up the source and destination instance variables, and ensures they validate.
Methods included from Validator
#validate_arguments, #validate_file_status
Constructor Details
#initialize(source, destination) ⇒ Builder
Sets up the source and destination instance variables, and ensures they validate.
10 11 12 13 14 |
# File 'lib/icon_generator/builder.rb', line 10 def initialize(source, destination) @source = source @destination = destination validate_arguments @source, @destination end |
Instance Method Details
#build(type) ⇒ Object
Requests a build of the given image type.
19 20 21 22 23 24 25 |
# File 'lib/icon_generator/builder.rb', line 19 def build(type) if type == :touch IconGenerator::TouchBuilder.new.build(@source, @destination) elsif type == :favicon IconGenerator::FaviconBuilder.new.build(@source, @destination) end end |
#build_single ⇒ Object
Builds a single touch icon.
28 29 30 |
# File 'lib/icon_generator/builder.rb', line 28 def build_single IconGenerator::TouchBuilder.new.build_single(@source, @destination) end |