Class: Brval::Val
- Inherits:
-
Object
show all
- Defined in:
- lib/brval/val.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(code) ⇒ Val
6
7
8
9
|
# File 'lib/brval/val.rb', line 6
def initialize(code)
return if code.nil?
@code = code.tr('^0-9', '')
end
|
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
4
5
6
|
# File 'lib/brval/val.rb', line 4
def code
@code
end
|
Instance Method Details
#mask ⇒ Object
11
12
13
14
|
# File 'lib/brval/val.rb', line 11
def mask
return if @code.nil?
masked
end
|
#valid? ⇒ Boolean
16
17
18
19
|
# File 'lib/brval/val.rb', line 16
def valid?
return false if @code.nil?
validate_code
end
|