Class: Jekyll::Gensocial::ImageCreator::TextLayerConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll-gensocial/image_creator/text_layer_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash, base_path:) ⇒ TextLayerConfig

Returns a new instance of TextLayerConfig.



9
10
11
12
13
14
15
# File 'lib/jekyll-gensocial/image_creator/text_layer_config.rb', line 9

def initialize(hash, base_path:)
  @string = hash["string"]
  @font_path = File.join(base_path, hash["font_path"]) unless hash["font_path"].nil?
  @pointsize = hash["pointsize"]
  @fill = hash["fill"]
  @rect = Geometry::Rect.new(hash["rect"])
end

Instance Attribute Details

#fillObject (readonly)

Returns the value of attribute fill.



7
8
9
# File 'lib/jekyll-gensocial/image_creator/text_layer_config.rb', line 7

def fill
  @fill
end

#font_pathObject (readonly)

Returns the value of attribute font_path.



7
8
9
# File 'lib/jekyll-gensocial/image_creator/text_layer_config.rb', line 7

def font_path
  @font_path
end

#pointsizeObject (readonly)

Returns the value of attribute pointsize.



7
8
9
# File 'lib/jekyll-gensocial/image_creator/text_layer_config.rb', line 7

def pointsize
  @pointsize
end

#rectObject (readonly)

Returns the value of attribute rect.



7
8
9
# File 'lib/jekyll-gensocial/image_creator/text_layer_config.rb', line 7

def rect
  @rect
end

#stringObject (readonly)

Returns the value of attribute string.



7
8
9
# File 'lib/jekyll-gensocial/image_creator/text_layer_config.rb', line 7

def string
  @string
end