Class: Bs5::CollapseService
- Inherits:
-
Object
- Object
- Bs5::CollapseService
- Defined in:
- app/service/bs5/collapse_service.rb
Constant Summary collapse
- CONTROLS_ERR_MSG =
'Please provide either a `controls` option' \ ' containing the id of the collapsible element' \ ' or an ID selector as `target` options.'
Instance Attribute Summary collapse
-
#controls ⇒ Object
readonly
Returns the value of attribute controls.
-
#expanded ⇒ Object
readonly
Returns the value of attribute expanded.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
-
#initialize(expanded: false, target: nil, controls: nil) ⇒ CollapseService
constructor
A new instance of CollapseService.
- #to_hash ⇒ Object
Constructor Details
#initialize(expanded: false, target: nil, controls: nil) ⇒ CollapseService
Returns a new instance of CollapseService.
13 14 15 16 17 |
# File 'app/service/bs5/collapse_service.rb', line 13 def initialize(expanded: false, target: nil, controls: nil) @expanded = @target = target @controls = controls end |
Instance Attribute Details
#controls ⇒ Object (readonly)
Returns the value of attribute controls.
11 12 13 |
# File 'app/service/bs5/collapse_service.rb', line 11 def controls @controls end |
#expanded ⇒ Object (readonly)
Returns the value of attribute expanded.
11 12 13 |
# File 'app/service/bs5/collapse_service.rb', line 11 def @expanded end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
11 12 13 |
# File 'app/service/bs5/collapse_service.rb', line 11 def target @target end |
Instance Method Details
#to_hash ⇒ Object
19 20 21 22 23 24 |
# File 'app/service/bs5/collapse_service.rb', line 19 def to_hash { data: , aria: } end |