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.



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

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

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



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

def raw
  @raw
end

Instance Method Details

#bg_colorObject



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

def bg_color
  @raw["bgColor"]
end

#contrast_ratioObject



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

def contrast_ratio
  @raw["contrastRatio"]
end

#expected_contrast_ratioObject



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

def expected_contrast_ratio
  @raw["expectedContrastRatio"]
end

#fg_colorObject



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

def fg_color
  @raw["fgColor"]
end

#font_sizeObject



188
189
190
# File 'lib/axe/cuprite/results.rb', line 188

def font_size
  @raw["fontSize"]
end

#font_weightObject



192
193
194
# File 'lib/axe/cuprite/results.rb', line 192

def font_weight
  @raw["fontWeight"]
end