Class: Playmo::Answer
- Inherits:
-
Thor::Shell::Basic
- Object
- Thor::Shell::Basic
- Playmo::Answer
- Defined in:
- lib/playmo/answer.rb
Instance Attribute Summary collapse
-
#answer_text ⇒ Object
Returns the value of attribute answer_text.
-
#method_name ⇒ Object
Returns the value of attribute method_name.
-
#num ⇒ Object
Returns the value of attribute num.
Instance Method Summary collapse
-
#initialize(answer_text, method_name, num) ⇒ Answer
constructor
A new instance of Answer.
- #render ⇒ Object (also: #to_s)
Constructor Details
#initialize(answer_text, method_name, num) ⇒ Answer
Returns a new instance of Answer.
5 6 7 8 9 10 |
# File 'lib/playmo/answer.rb', line 5 def initialize(answer_text, method_name, num) @answer_text = answer_text @method_name = method_name @num = num @padding = 0 end |
Instance Attribute Details
#answer_text ⇒ Object
Returns the value of attribute answer_text.
3 4 5 |
# File 'lib/playmo/answer.rb', line 3 def answer_text @answer_text end |
#method_name ⇒ Object
Returns the value of attribute method_name.
3 4 5 |
# File 'lib/playmo/answer.rb', line 3 def method_name @method_name end |
#num ⇒ Object
Returns the value of attribute num.
3 4 5 |
# File 'lib/playmo/answer.rb', line 3 def num @num end |
Instance Method Details
#render ⇒ Object Also known as: to_s
12 13 14 |
# File 'lib/playmo/answer.rb', line 12 def render "#{@num}. #{@answer_text}\n" if @answer_text end |