Class: CSS::Nodes::UnicodeRange

Inherits:
Data
  • Object
show all
Defined in:
lib/css/nodes.rb

Overview

An inclusive code-point range, e.g. ‘U+0-7F`. Result of CSS.parse_urange.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#firstObject (readonly)

Returns the value of attribute first

Returns:

  • (Object)

    the current value of first



34
35
36
# File 'lib/css/nodes.rb', line 34

def first
  @first
end

#lastObject (readonly)

Returns the value of attribute last

Returns:

  • (Object)

    the current value of last



34
35
36
# File 'lib/css/nodes.rb', line 34

def last
  @last
end

Instance Method Details

#cover?(cp) ⇒ Boolean

Returns:

  • (Boolean)


35
# File 'lib/css/nodes.rb', line 35

def cover?(cp) = (first..last).cover?(cp)

#to_sObject



37
38
39
# File 'lib/css/nodes.rb', line 37

def to_s
  first == last ? format('U+%X', first) : format('U+%X-%X', first, last)
end