Class: Quby::Questionnaires::Entities::Item
- Inherits:
-
Object
- Object
- Quby::Questionnaires::Entities::Item
- Includes:
- ActiveModel::Validations, ActiveSupport::Callbacks
- Defined in:
- lib/quby/questionnaires/entities/item.rb
Instance Attribute Summary collapse
- #presentation ⇒ Object
-
#raw_content ⇒ Object
Raw content may contain a raw HTML replacement for this item.
-
#switch_cycle ⇒ Object
Returns the value of attribute switch_cycle.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Item
constructor
A new instance of Item.
Constructor Details
#initialize(options = {}) ⇒ Item
Returns a new instance of Item.
19 20 21 22 |
# File 'lib/quby/questionnaires/entities/item.rb', line 19 def initialize( = {}) @raw_content = [:raw_content] @switch_cycle = [:switch_cycle] || false end |
Instance Attribute Details
#presentation ⇒ Object
24 25 26 |
# File 'lib/quby/questionnaires/entities/item.rb', line 24 def presentation @presentation || "vertical" end |
#raw_content ⇒ Object
Raw content may contain a raw HTML replacement for this item
17 18 19 |
# File 'lib/quby/questionnaires/entities/item.rb', line 17 def raw_content @raw_content end |
#switch_cycle ⇒ Object
Returns the value of attribute switch_cycle.
14 15 16 |
# File 'lib/quby/questionnaires/entities/item.rb', line 14 def switch_cycle @switch_cycle end |
Instance Method Details
#as_json(options = {}) ⇒ Object
28 29 30 31 32 |
# File 'lib/quby/questionnaires/entities/item.rb', line 28 def as_json( = {}) { class: self.class.to_s } end |