Class: ColorContrastCalc::ColorFunctionParser::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/color_contrast_calc/color_function_parser.rb

Direct Known Subclasses

FunctionParser, ValueParser

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.functionObject

Returns the value of attribute function.



381
382
383
# File 'lib/color_contrast_calc/color_function_parser.rb', line 381

def function
  @function
end

.mainObject

Returns the value of attribute main.



381
382
383
# File 'lib/color_contrast_calc/color_function_parser.rb', line 381

def main
  @main
end

.parsersObject

Returns the value of attribute parsers.



381
382
383
# File 'lib/color_contrast_calc/color_function_parser.rb', line 381

def parsers
  @parsers
end

.valueObject

Returns the value of attribute value.



381
382
383
# File 'lib/color_contrast_calc/color_function_parser.rb', line 381

def value
  @value
end

Instance Method Details

#read_scheme!(scanner) ⇒ Object



390
391
392
393
394
395
396
397
398
399
400
401
# File 'lib/color_contrast_calc/color_function_parser.rb', line 390

def read_scheme!(scanner)
  scheme = read_token!(scanner, TokenRe::SCHEME).downcase

  parsed_value = {
    scheme: scheme,
    parameters: []
  }

  parser = Parser.parsers[scheme] || self

  parser.read_open_paren!(scanner, parsed_value)
end