Class: Plushie::Type::A11y::Spec
- Inherits:
-
Data
- Object
- Data
- Plushie::Type::A11y::Spec
- Defined in:
- lib/plushie/type/a11y.rb,
sig/plushie/type/a11y.rbs
Overview
Immutable spec; use #with to create modified copies.
Instance Attribute Summary collapse
-
#busy ⇒ Boolean?
readonly
Returns the value of attribute busy.
-
#described_by ⇒ String?
readonly
Returns the value of attribute described_by.
-
#description ⇒ String?
readonly
Returns the value of attribute description.
-
#disabled ⇒ Boolean?
readonly
Returns the value of attribute disabled.
-
#error_message ⇒ String?
readonly
Returns the value of attribute error_message.
-
#expanded ⇒ Boolean?
readonly
Returns the value of attribute expanded.
-
#has_popup ⇒ String?
readonly
Returns the value of attribute has_popup.
-
#hidden ⇒ Boolean?
readonly
Returns the value of attribute hidden.
-
#invalid ⇒ Boolean?
readonly
Returns the value of attribute invalid.
-
#label ⇒ String?
readonly
Returns the value of attribute label.
-
#labelled_by ⇒ String?
readonly
Returns the value of attribute labelled_by.
-
#level ⇒ Integer?
readonly
Returns the value of attribute level.
-
#live ⇒ String?
readonly
Returns the value of attribute live.
-
#mnemonic ⇒ String?
readonly
Returns the value of attribute mnemonic.
-
#modal ⇒ Boolean?
readonly
Returns the value of attribute modal.
-
#orientation ⇒ String?
readonly
Returns the value of attribute orientation.
-
#position_in_set ⇒ Integer?
readonly
Returns the value of attribute position_in_set.
-
#read_only ⇒ Boolean?
readonly
Returns the value of attribute read_only.
-
#required ⇒ Boolean?
readonly
Returns the value of attribute required.
-
#role ⇒ Symbol?
readonly
Returns the value of attribute role.
-
#selected ⇒ Boolean?
readonly
Returns the value of attribute selected.
-
#size_of_set ⇒ Integer?
readonly
Returns the value of attribute size_of_set.
-
#toggled ⇒ Boolean?
readonly
Returns the value of attribute toggled.
-
#value ⇒ String?
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(**fields) ⇒ Spec
constructor
A new instance of Spec.
-
#to_wire ⇒ Hash
Wire-ready map with nil fields stripped.
-
#with(**changes) ⇒ Spec
Returns a copy with the given fields updated.
Constructor Details
#initialize(**fields) ⇒ Spec
Returns a new instance of Spec.
42 43 44 45 |
# File 'lib/plushie/type/a11y.rb', line 42 def initialize(**fields) defaults = FIELD_KEYS.each_with_object({}) { |k, h| h[k] = nil } super(**defaults.merge(fields)) end |
Instance Attribute Details
#busy ⇒ Boolean? (readonly)
Returns the value of attribute busy.
16 17 18 |
# File 'sig/plushie/type/a11y.rbs', line 16 def busy @busy end |
#described_by ⇒ String? (readonly)
Returns the value of attribute described_by.
26 27 28 |
# File 'sig/plushie/type/a11y.rbs', line 26 def described_by @described_by end |
#description ⇒ String? (readonly)
Returns the value of attribute description.
10 11 12 |
# File 'sig/plushie/type/a11y.rbs', line 10 def description @description end |
#disabled ⇒ Boolean? (readonly)
Returns the value of attribute disabled.
28 29 30 |
# File 'sig/plushie/type/a11y.rbs', line 28 def disabled @disabled end |
#error_message ⇒ String? (readonly)
Returns the value of attribute error_message.
27 28 29 |
# File 'sig/plushie/type/a11y.rbs', line 27 def @error_message end |
#expanded ⇒ Boolean? (readonly)
Returns the value of attribute expanded.
12 13 14 |
# File 'sig/plushie/type/a11y.rbs', line 12 def @expanded end |
#has_popup ⇒ String? (readonly)
Returns the value of attribute has_popup.
31 32 33 |
# File 'sig/plushie/type/a11y.rbs', line 31 def has_popup @has_popup end |
#hidden ⇒ Boolean? (readonly)
Returns the value of attribute hidden.
11 12 13 |
# File 'sig/plushie/type/a11y.rbs', line 11 def hidden @hidden end |
#invalid ⇒ Boolean? (readonly)
Returns the value of attribute invalid.
17 18 19 |
# File 'sig/plushie/type/a11y.rbs', line 17 def invalid @invalid end |
#label ⇒ String? (readonly)
Returns the value of attribute label.
9 10 11 |
# File 'sig/plushie/type/a11y.rbs', line 9 def label @label end |
#labelled_by ⇒ String? (readonly)
Returns the value of attribute labelled_by.
25 26 27 |
# File 'sig/plushie/type/a11y.rbs', line 25 def labelled_by @labelled_by end |
#level ⇒ Integer? (readonly)
Returns the value of attribute level.
14 15 16 |
# File 'sig/plushie/type/a11y.rbs', line 14 def level @level end |
#live ⇒ String? (readonly)
Returns the value of attribute live.
15 16 17 |
# File 'sig/plushie/type/a11y.rbs', line 15 def live @live end |
#mnemonic ⇒ String? (readonly)
Returns the value of attribute mnemonic.
20 21 22 |
# File 'sig/plushie/type/a11y.rbs', line 20 def mnemonic @mnemonic end |
#modal ⇒ Boolean? (readonly)
Returns the value of attribute modal.
18 19 20 |
# File 'sig/plushie/type/a11y.rbs', line 18 def modal @modal end |
#orientation ⇒ String? (readonly)
Returns the value of attribute orientation.
24 25 26 |
# File 'sig/plushie/type/a11y.rbs', line 24 def orientation @orientation end |
#position_in_set ⇒ Integer? (readonly)
Returns the value of attribute position_in_set.
29 30 31 |
# File 'sig/plushie/type/a11y.rbs', line 29 def position_in_set @position_in_set end |
#read_only ⇒ Boolean? (readonly)
Returns the value of attribute read_only.
19 20 21 |
# File 'sig/plushie/type/a11y.rbs', line 19 def read_only @read_only end |
#required ⇒ Boolean? (readonly)
Returns the value of attribute required.
13 14 15 |
# File 'sig/plushie/type/a11y.rbs', line 13 def required @required end |
#role ⇒ Symbol? (readonly)
Returns the value of attribute role.
8 9 10 |
# File 'sig/plushie/type/a11y.rbs', line 8 def role @role end |
#selected ⇒ Boolean? (readonly)
Returns the value of attribute selected.
22 23 24 |
# File 'sig/plushie/type/a11y.rbs', line 22 def selected @selected end |
#size_of_set ⇒ Integer? (readonly)
Returns the value of attribute size_of_set.
30 31 32 |
# File 'sig/plushie/type/a11y.rbs', line 30 def size_of_set @size_of_set end |
#toggled ⇒ Boolean? (readonly)
Returns the value of attribute toggled.
21 22 23 |
# File 'sig/plushie/type/a11y.rbs', line 21 def toggled @toggled end |
#value ⇒ String? (readonly)
Returns the value of attribute value.
23 24 25 |
# File 'sig/plushie/type/a11y.rbs', line 23 def value @value end |
Instance Method Details
#to_wire ⇒ Hash
Returns wire-ready map with nil fields stripped.
53 54 55 |
# File 'lib/plushie/type/a11y.rb', line 53 def to_wire to_h.compact end |
#with(**changes) ⇒ Spec
Returns a copy with the given fields updated.
48 49 50 |
# File 'lib/plushie/type/a11y.rb', line 48 def with(**changes) self.class.new(**to_h.merge(changes)) end |