Class: AxeCuprite::ContrastData

Inherits:
Object
  • Object
show all
Defined in:
lib/axe/cuprite/results.rb

Overview

Typed view over a color-contrast check’s ‘data` hash.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ ContrastData

Returns a new instance of ContrastData.



139
140
141
# File 'lib/axe/cuprite/results.rb', line 139

def initialize(raw)
  @raw = raw || {}
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



137
138
139
# File 'lib/axe/cuprite/results.rb', line 137

def raw
  @raw
end

Instance Method Details

#bg_colorObject



147
148
149
# File 'lib/axe/cuprite/results.rb', line 147

def bg_color
  @raw["bgColor"]
end

#contrast_ratioObject



151
152
153
# File 'lib/axe/cuprite/results.rb', line 151

def contrast_ratio
  @raw["contrastRatio"]
end

#expected_contrast_ratioObject



155
156
157
# File 'lib/axe/cuprite/results.rb', line 155

def expected_contrast_ratio
  @raw["expectedContrastRatio"]
end

#fg_colorObject



143
144
145
# File 'lib/axe/cuprite/results.rb', line 143

def fg_color
  @raw["fgColor"]
end

#font_sizeObject



159
160
161
# File 'lib/axe/cuprite/results.rb', line 159

def font_size
  @raw["fontSize"]
end

#font_weightObject



163
164
165
# File 'lib/axe/cuprite/results.rb', line 163

def font_weight
  @raw["fontWeight"]
end