Class: Quby::Questionnaires::Entities::Textvar
- Inherits:
-
Struct
- Object
- Struct
- Quby::Questionnaires::Entities::Textvar
- Defined in:
- lib/quby/questionnaires/entities/textvar.rb
Instance Attribute Summary collapse
-
#default ⇒ Object
Returns the value of attribute default.
-
#depends_on_flag ⇒ Object
Returns the value of attribute depends_on_flag.
-
#description ⇒ Object
Returns the value of attribute description.
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
-
#initialize(key:, description:, default: nil, depends_on_flag: nil) ⇒ Textvar
constructor
rubocop:disable ParameterLists.
-
#to_codebook(_options = {}) ⇒ Object
rubocop:enable ParameterLists.
Constructor Details
#initialize(key:, description:, default: nil, depends_on_flag: nil) ⇒ Textvar
rubocop:disable ParameterLists
8 9 10 11 |
# File 'lib/quby/questionnaires/entities/textvar.rb', line 8 def initialize(key:, description:, default: nil, depends_on_flag: nil) default = "{{#{key}}}" unless default super(key, description, default, depends_on_flag) end |
Instance Attribute Details
#default ⇒ Object
Returns the value of attribute default
6 7 8 |
# File 'lib/quby/questionnaires/entities/textvar.rb', line 6 def default @default end |
#depends_on_flag ⇒ Object
Returns the value of attribute depends_on_flag
6 7 8 |
# File 'lib/quby/questionnaires/entities/textvar.rb', line 6 def depends_on_flag @depends_on_flag end |
#description ⇒ Object
Returns the value of attribute description
6 7 8 |
# File 'lib/quby/questionnaires/entities/textvar.rb', line 6 def description @description end |
#key ⇒ Object
Returns the value of attribute key
6 7 8 |
# File 'lib/quby/questionnaires/entities/textvar.rb', line 6 def key @key end |
Instance Method Details
#to_codebook(_options = {}) ⇒ Object
rubocop:enable ParameterLists
14 15 16 17 18 19 |
# File 'lib/quby/questionnaires/entities/textvar.rb', line 14 def to_codebook( = {}) output = [] output << "#{key} Textvariabele" output << description output.join("\n") end |