Class: Icodi
- Inherits:
-
Victor::SVGBase
- Object
- Victor::SVGBase
- Icodi
- Includes:
- IcodiCore::Options, IcodiCore::Randomization
- Defined in:
- lib/icodi.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text = nil, opts = {}) ⇒ Icodi
constructor
A new instance of Icodi.
Methods included from IcodiCore::Randomization
Methods included from IcodiCore::Options
#background, #color, #default_options, #density, #id, #jitter, #mirror, #mirror_both?, #mirror_x?, #mirror_y?, #pixels, #size, #stroke, #style
Constructor Details
#initialize(text = nil, opts = {}) ⇒ Icodi
Returns a new instance of Icodi.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/icodi.rb', line 12 def initialize(text = nil, opts = {}) if text.is_a? Hash opts = text text = nil end svg_template = opts.delete :template @text = text @options = .merge opts super template: svg_template, viewBox: "0 0 #{size} #{size}", id: id generate end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/icodi.rb', line 10 def @options end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
10 11 12 |
# File 'lib/icodi.rb', line 10 def text @text end |