Sha256: b4cfc67245326196f8596ac25c5e70a8e64f4f69f3ed098c5671deca9cf61ca6

Contents?: true

Size: 717 Bytes

Versions: 3

Compression:

Stored size: 717 Bytes

Contents

require_relative 'arg_loader'

module Squib::Args
  module_function def extract_svg_special(opts, deck)
    SvgSpecial.new.extract! opts, deck
  end
  
  class SvgSpecial
    include ArgLoader

    def self.parameters
      { data: nil, id: nil, force_id: false }
    end

    def self.expanding_parameters
      parameters.keys # all of them
    end

    def self.params_with_units
      []
    end

    def validate_id(arg, _i)
      return nil if arg.to_s.empty?
      arg = '#' << arg unless arg.start_with? '#'
      arg
    end

    # Only render if we have an ID specified, or we are forcing an ID
    def render?(i)
      return false if force_id[i] && id[i].to_s.empty?
      return true
    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
squib-0.19.0 lib/squib/args/svg_special.rb
squib-0.19.0b lib/squib/args/svg_special.rb
squib-0.19.0a lib/squib/args/svg_special.rb