Class: Icodi

Inherits:
Victor::SVGBase
  • Object
show all
Includes:
IcodiCore::OptionHandling, IcodiCore::Randomization
Defined in:
lib/icodi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from IcodiCore::Randomization

#random, #random_color, #random_sets, #seed

Methods included from IcodiCore::OptionHandling

#default_options, #method_missing, #mirror_both?, #mirror_x?, #mirror_y?, #respond_to?, #size, #style

Constructor Details

#initialize(text = nil, opts = {}) ⇒ Icodi

Returns a new instance of Icodi.



12
13
14
15
16
17
18
19
20
21
# File 'lib/icodi.rb', line 12

def initialize(text = nil, opts = {})
  text, opts = nil, text if text.is_a? Hash
  
  @text = text
  @options = default_options.merge opts

  super template: template, viewBox: "0 0 #{size} #{size}", id: id
  
  generate
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class IcodiCore::OptionHandling

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



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

def options
  @options
end

#textObject (readonly)

Returns the value of attribute text.



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

def text
  @text
end