Class: SvgoOptions
- Inherits:
-
Object
- Object
- SvgoOptions
- Defined in:
- lib/svgo.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #floatPrecision ⇒ Object
- #floatPrecision=(floatPrecision) ⇒ Object
- #get_options(*args) ⇒ Object
-
#initialize {|@options| ... } ⇒ SvgoOptions
constructor
A new instance of SvgoOptions.
- #js2svg ⇒ Object
- #js2svg=(js2svg) ⇒ Object
- #multipass ⇒ Object
- #multipass=(multipass) ⇒ Object
- #plugins ⇒ Object
- #plugins=(plugins) ⇒ Object
- #runtime ⇒ Object
- #runtime=(runtime) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize {|@options| ... } ⇒ SvgoOptions
Returns a new instance of SvgoOptions.
47 48 49 50 51 52 53 54 55 |
# File 'lib/svgo.rb', line 47 def initialize @options = OpenStruct.new( js2svg: OpenStruct.new(pretty: false), plugins: PLUGINS_DEFAULT, floatPrecision: 6, multipass: false ) yield @options if block_given? end |
Instance Method Details
#[](key) ⇒ Object
99 100 101 |
# File 'lib/svgo.rb', line 99 def [](key) @options[key.to_sym] end |
#floatPrecision ⇒ Object
83 84 85 |
# File 'lib/svgo.rb', line 83 def floatPrecision @options.floatPrecision end |
#floatPrecision=(floatPrecision) ⇒ Object
87 88 89 |
# File 'lib/svgo.rb', line 87 def floatPrecision=(floatPrecision) @options.floatPrecision = floatPrecision end |
#get_options(*args) ⇒ Object
57 58 59 60 61 |
# File 'lib/svgo.rb', line 57 def (*args) = @options.to_h [:js2svg] = [:js2svg].to_h end |
#js2svg ⇒ Object
67 68 69 |
# File 'lib/svgo.rb', line 67 def js2svg @options.js2svg end |
#js2svg=(js2svg) ⇒ Object
71 72 73 |
# File 'lib/svgo.rb', line 71 def js2svg=(js2svg) @options.js2svg = js2svg end |
#multipass ⇒ Object
91 92 93 |
# File 'lib/svgo.rb', line 91 def multipass @options.multipass end |
#multipass=(multipass) ⇒ Object
95 96 97 |
# File 'lib/svgo.rb', line 95 def multipass=(multipass) @options.multipass = multipass end |
#plugins ⇒ Object
75 76 77 |
# File 'lib/svgo.rb', line 75 def plugins @options.plugins end |
#plugins=(plugins) ⇒ Object
79 80 81 |
# File 'lib/svgo.rb', line 79 def plugins=(plugins) @options.plugins = plugins end |
#runtime ⇒ Object
103 104 105 |
# File 'lib/svgo.rb', line 103 def runtime @options.runtime end |
#runtime=(runtime) ⇒ Object
107 108 109 |
# File 'lib/svgo.rb', line 107 def runtime=(runtime) @options.runtime = runtime end |
#to_s ⇒ Object
63 64 65 |
# File 'lib/svgo.rb', line 63 def to_s .to_json end |