Module: LetterAvatar::Configuration
- Included in:
- LetterAvatar
- Defined in:
- lib/letter_avatar/configuration.rb
Instance Method Summary collapse
- #annotate_position ⇒ Object
- #annotate_position=(v) ⇒ Object
- #cache_base_path ⇒ Object
- #cache_base_path=(v) ⇒ Object
- #colors_palette ⇒ Object
- #colors_palette=(v) ⇒ Object
- #custom_palette ⇒ Object
- #custom_palette=(v) ⇒ Object
- #fill_color ⇒ Object
- #fill_color=(v) ⇒ Object
- #font ⇒ Object
- #font=(v) ⇒ Object
- #letters_count ⇒ Object
- #letters_count=(v) ⇒ Object
- #pointsize ⇒ Object
- #pointsize=(v) ⇒ Object
- #weight ⇒ Object
- #weight=(v) ⇒ Object
Instance Method Details
#annotate_position ⇒ Object
53 54 55 |
# File 'lib/letter_avatar/configuration.rb', line 53 def annotate_position @annotate_position ||= '-0+5' end |
#annotate_position=(v) ⇒ Object
57 58 59 |
# File 'lib/letter_avatar/configuration.rb', line 57 def annotate_position=(v) @annotate_position = v end |
#cache_base_path ⇒ Object
3 4 5 |
# File 'lib/letter_avatar/configuration.rb', line 3 def cache_base_path @cache_base_path end |
#cache_base_path=(v) ⇒ Object
7 8 9 |
# File 'lib/letter_avatar/configuration.rb', line 7 def cache_base_path=(v) @cache_base_path = v end |
#colors_palette ⇒ Object
27 28 29 |
# File 'lib/letter_avatar/configuration.rb', line 27 def colors_palette @colors_palette ||= :google end |
#colors_palette=(v) ⇒ Object
31 32 33 |
# File 'lib/letter_avatar/configuration.rb', line 31 def colors_palette=(v) @colors_palette = v if Colors::PALETTES.include?(v) end |
#custom_palette ⇒ Object
35 36 37 |
# File 'lib/letter_avatar/configuration.rb', line 35 def custom_palette @custom_palette ||= nil end |
#custom_palette=(v) ⇒ Object
39 40 41 42 43 |
# File 'lib/letter_avatar/configuration.rb', line 39 def custom_palette=(v) @custom_palette = v raise "Missing Custom Palette, please set config.custom_palette if using :custom" if @custom_palette.nil? && @colors_palette == :custom raise "Invalid Custom Palette, please update config.custom_palette" unless Colors::valid_custom_palette?(@custom_palette) end |
#fill_color ⇒ Object
19 20 21 |
# File 'lib/letter_avatar/configuration.rb', line 19 def fill_color @fill_color || Avatar::FILL_COLOR end |
#fill_color=(v) ⇒ Object
23 24 25 |
# File 'lib/letter_avatar/configuration.rb', line 23 def fill_color=(v) @fill_color = v end |
#font ⇒ Object
11 12 13 |
# File 'lib/letter_avatar/configuration.rb', line 11 def font @font || Avatar::FONT_FILENAME end |
#font=(v) ⇒ Object
15 16 17 |
# File 'lib/letter_avatar/configuration.rb', line 15 def font=(v) @font = v end |
#letters_count ⇒ Object
61 62 63 |
# File 'lib/letter_avatar/configuration.rb', line 61 def letters_count @letters_count ||= 1 end |
#letters_count=(v) ⇒ Object
65 66 67 |
# File 'lib/letter_avatar/configuration.rb', line 65 def letters_count=(v) @letters_count = v end |
#pointsize ⇒ Object
69 70 71 |
# File 'lib/letter_avatar/configuration.rb', line 69 def pointsize @pointsize ||= 140 end |
#pointsize=(v) ⇒ Object
73 74 75 |
# File 'lib/letter_avatar/configuration.rb', line 73 def pointsize=(v) @pointsize = v end |
#weight ⇒ Object
45 46 47 |
# File 'lib/letter_avatar/configuration.rb', line 45 def weight @weight ||= 300 end |
#weight=(v) ⇒ Object
49 50 51 |
# File 'lib/letter_avatar/configuration.rb', line 49 def weight=(v) @weight = v end |