Class: AskAwesomely::Choice
- Inherits:
-
Object
- Object
- AskAwesomely::Choice
- Includes:
- JsonBuilder
- Defined in:
- lib/ask_awesomely/choice.rb
Instance Attribute Summary collapse
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
-
#initialize(label:, picture: nil) ⇒ Choice
constructor
A new instance of Choice.
Methods included from JsonBuilder
Constructor Details
#initialize(label:, picture: nil) ⇒ Choice
Returns a new instance of Choice.
8 9 10 11 12 13 14 15 16 |
# File 'lib/ask_awesomely/choice.rb', line 8 def initialize(label:, picture: nil) @state = OpenStruct.new( label: label, ) if picture @state.image_id = proc { Picture.new(picture).typeform_id } end end |
Instance Attribute Details
#state ⇒ Object (readonly)
Returns the value of attribute state.
6 7 8 |
# File 'lib/ask_awesomely/choice.rb', line 6 def state @state end |