Class: Quby::Compiler::Entities::InfoBlock
- Defined in:
- lib/quby/compiler/entities/info_block.rb
Instance Attribute Summary collapse
-
#html ⇒ Object
Returns the value of attribute html.
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#panel ⇒ Object
readonly
Returns the value of attribute panel.
-
#start_open ⇒ Object
readonly
Returns the value of attribute start_open.
-
#subtype ⇒ Object
readonly
Returns the value of attribute subtype.
Attributes inherited from Item
#presentation, #raw_content, #switch_cycle
Instance Method Summary collapse
- #index ⇒ Object
-
#initialize(key:, panel:, start_open: true, subtype: "info") ⇒ InfoBlock
constructor
A new instance of InfoBlock.
- #path_str ⇒ Object
- #type ⇒ Object
Methods inherited from Item
Constructor Details
#initialize(key:, panel:, start_open: true, subtype: "info") ⇒ InfoBlock
Returns a new instance of InfoBlock.
12 13 14 15 16 17 18 |
# File 'lib/quby/compiler/entities/info_block.rb', line 12 def initialize(key:, panel:, start_open: true, subtype: "info") @panel = panel @key = key @start_open = start_open @subtype = subtype @items = [] end |
Instance Attribute Details
#html ⇒ Object
Returns the value of attribute html.
6 7 8 |
# File 'lib/quby/compiler/entities/info_block.rb', line 6 def html @html end |
#items ⇒ Object (readonly)
Returns the value of attribute items.
5 6 7 |
# File 'lib/quby/compiler/entities/info_block.rb', line 5 def items @items end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/quby/compiler/entities/info_block.rb', line 5 def key @key end |
#panel ⇒ Object (readonly)
Returns the value of attribute panel.
5 6 7 |
# File 'lib/quby/compiler/entities/info_block.rb', line 5 def panel @panel end |
#start_open ⇒ Object (readonly)
Returns the value of attribute start_open.
5 6 7 |
# File 'lib/quby/compiler/entities/info_block.rb', line 5 def start_open @start_open end |
#subtype ⇒ Object (readonly)
Returns the value of attribute subtype.
5 6 7 |
# File 'lib/quby/compiler/entities/info_block.rb', line 5 def subtype @subtype end |
Instance Method Details
#index ⇒ Object
20 21 22 |
# File 'lib/quby/compiler/entities/info_block.rb', line 20 def index panel.items.index(self) end |
#path_str ⇒ Object
28 29 30 |
# File 'lib/quby/compiler/entities/info_block.rb', line 28 def path_str "#{panel.questionnaire.key}:InfoBlock:#{key}" end |
#type ⇒ Object
24 25 26 |
# File 'lib/quby/compiler/entities/info_block.rb', line 24 def type "info" end |