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.



161
162
163
# File 'lib/axe/cuprite/results.rb', line 161

def initialize(raw)
  @raw = DeepFreeze.call(raw || {})
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



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

def raw
  @raw
end

Instance Method Details

#bg_colorObject



169
170
171
# File 'lib/axe/cuprite/results.rb', line 169

def bg_color
  @raw["bgColor"]
end

#contrast_ratioObject



173
174
175
# File 'lib/axe/cuprite/results.rb', line 173

def contrast_ratio
  @raw["contrastRatio"]
end

#expected_contrast_ratioObject



177
178
179
# File 'lib/axe/cuprite/results.rb', line 177

def expected_contrast_ratio
  @raw["expectedContrastRatio"]
end

#fg_colorObject



165
166
167
# File 'lib/axe/cuprite/results.rb', line 165

def fg_color
  @raw["fgColor"]
end

#font_sizeObject



181
182
183
# File 'lib/axe/cuprite/results.rb', line 181

def font_size
  @raw["fontSize"]
end

#font_weightObject



185
186
187
# File 'lib/axe/cuprite/results.rb', line 185

def font_weight
  @raw["fontWeight"]
end