Class: ThumbGen::Generator

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/thumb_gen/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils

#draw_text, #split_word_into_lines, #word_too_wide?, #word_wrap

Constructor Details

#initialize(output_path, background_url, texts, options) ⇒ Generator

Returns a new instance of Generator.



12
13
14
15
16
17
# File 'lib/thumb_gen/generator.rb', line 12

def initialize(output_path, background_url, texts, options)
  @output_path = output_path
  @background_url = background_url
  @texts = texts
  @options = options
end

Instance Attribute Details

#background_urlObject (readonly)

Returns the value of attribute background_url.



10
11
12
# File 'lib/thumb_gen/generator.rb', line 10

def background_url
  @background_url
end

#optionsObject (readonly)

Returns the value of attribute options.



10
11
12
# File 'lib/thumb_gen/generator.rb', line 10

def options
  @options
end

#output_pathObject (readonly)

Returns the value of attribute output_path.



10
11
12
# File 'lib/thumb_gen/generator.rb', line 10

def output_path
  @output_path
end

#textsObject (readonly)

Returns the value of attribute texts.



10
11
12
# File 'lib/thumb_gen/generator.rb', line 10

def texts
  @texts
end

Instance Method Details

#generateObject



19
20
21
# File 'lib/thumb_gen/generator.rb', line 19

def generate
  generate_image
end