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
Returns the value of attribute presentation.
-
#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.
- #to_codebook(questionnaire, options = {}) ⇒ Object
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
Returns the value of attribute presentation.
13 14 15 |
# File 'lib/quby/questionnaires/entities/item.rb', line 13 def presentation @presentation 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 |
#to_codebook(questionnaire, options = {}) ⇒ Object
34 35 36 |
# File 'lib/quby/questionnaires/entities/item.rb', line 34 def to_codebook(questionnaire, = {}) "" end |