Class: Smartdown::Model::Answer::Base
- Inherits:
-
Object
- Object
- Smartdown::Model::Answer::Base
- Extended by:
- Forwardable
- Includes:
- Comparable
- Defined in:
- lib/smartdown/model/answer/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#question ⇒ Object
readonly
Returns the value of attribute question.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
-
#initialize(question, value) ⇒ Base
constructor
A new instance of Base.
- #value_type ⇒ Object
Constructor Details
#initialize(question, value) ⇒ Base
Returns a new instance of Base.
20 21 22 23 |
# File 'lib/smartdown/model/answer/base.rb', line 20 def initialize(question, value) @question = question @value = parse_value(value) end |
Instance Attribute Details
#question ⇒ Object (readonly)
Returns the value of attribute question.
18 19 20 |
# File 'lib/smartdown/model/answer/base.rb', line 18 def question @question end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
18 19 20 |
# File 'lib/smartdown/model/answer/base.rb', line 18 def value @value end |
Instance Method Details
#<=>(other) ⇒ Object
14 15 16 |
# File 'lib/smartdown/model/answer/base.rb', line 14 def <=>(other) value <=> parse_comparison_object(other) end |
#value_type ⇒ Object
10 11 12 |
# File 'lib/smartdown/model/answer/base.rb', line 10 def value_type ::String end |