Class: Workbook::NilValue
- Inherits:
-
Object
- Object
- Workbook::NilValue
- Defined in:
- lib/workbook/nil_value.rb
Overview
Used in cases col or rowspans are used
Instance Method Summary collapse
- #<=>(v) ⇒ Object
-
#initialize(reason) ⇒ NilValue
constructor
initialize this special nilvalue with a reason.
- #reason ⇒ Object
-
#reason=(reason) ⇒ Object
set the reason why this value is nil.
-
#value ⇒ NilClass
returns the value of itself (nil).
Constructor Details
#initialize(reason) ⇒ NilValue
initialize this special nilvalue with a reason
10 11 12 |
# File 'lib/workbook/nil_value.rb', line 10 def initialize reason self.reason= reason end |
Instance Method Details
#<=>(v) ⇒ Object
20 21 22 |
# File 'lib/workbook/nil_value.rb', line 20 def <=> v value <=> v end |
#reason ⇒ Object
24 25 26 |
# File 'lib/workbook/nil_value.rb', line 24 def reason @reason end |
#reason=(reason) ⇒ Object
set the reason why this value is nil
29 30 31 32 33 34 35 |
# File 'lib/workbook/nil_value.rb', line 29 def reason= reason if reason == :covered @reason = reason else raise "invalid reason given" end end |
#value ⇒ NilClass
returns the value of itself (nil)
16 17 18 |
# File 'lib/workbook/nil_value.rb', line 16 def value nil end |