Class: Cellularity::Min

Inherits:
Object
  • Object
show all
Defined in:
lib/cellularity/min.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#minObject

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

Returns:

  • (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