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.
- #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) raise ArgumentError, 'The br code informed is nil' 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
#valid? ⇒ Boolean
11 12 13 |
# File 'lib/brval/val.rb', line 11 def valid? validate_code end |