Class: Brval::Val
- Inherits:
-
Object
- Object
- Brval::Val
- Defined in:
- lib/brval/val.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(code) ⇒ Val
constructor
A new instance of Val.
- #mask ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(code) ⇒ Val
Returns a new instance of 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 |