Class: Smartdown::Api::Question
- Inherits:
-
Object
- Object
- Smartdown::Api::Question
- Defined in:
- lib/smartdown/api/question.rb
Direct Known Subclasses
Instance Method Summary collapse
- #body ⇒ Object
-
#hint ⇒ Object
TODO: deprecate.
-
#initialize(elements) ⇒ Question
constructor
A new instance of Question.
- #title ⇒ Object
Constructor Details
#initialize(elements) ⇒ Question
Returns a new instance of Question.
5 6 7 |
# File 'lib/smartdown/api/question.rb', line 5 def initialize(elements) @elements = elements end |
Instance Method Details
#body ⇒ Object
13 14 15 16 |
# File 'lib/smartdown/api/question.rb', line 13 def body elements_before_smartdown = elements[1..-1].take_while{|element| !smartdown_element?(element)} build_govspeak(elements_before_smartdown) end |
#hint ⇒ Object
TODO: deprecate
19 20 |
# File 'lib/smartdown/api/question.rb', line 19 def hint end |
#title ⇒ Object
9 10 11 |
# File 'lib/smartdown/api/question.rb', line 9 def title elements.first.content end |