Class: Cellularity::Min
- Inherits:
-
Object
- Object
- Cellularity::Min
- Defined in:
- lib/cellularity/min.rb
Instance Attribute Summary collapse
-
#min ⇒ Object
Returns the value of attribute min.
Instance Method Summary collapse
-
#initialize(min = '') ⇒ Min
constructor
A new instance of Min.
- #valid? ⇒ Boolean
Constructor Details
#initialize(min = '') ⇒ Min
Returns a new instance of Min.
6 7 8 |
# File 'lib/cellularity/min.rb', line 6 def initialize(min = '') self.min = min.to_s end |
Instance Attribute Details
#min ⇒ Object
Returns the value of attribute min.
4 5 6 |
# File 'lib/cellularity/min.rb', line 4 def min @min end |
Instance Method Details
#valid? ⇒ Boolean
10 11 12 13 14 |
# File 'lib/cellularity/min.rb', line 10 def valid? self.min.length == 10 && !!Integer(self.min) rescue ArgumentError, TypeError false end |