Class: TinValid::GreeceTin
- Inherits:
-
Object
- Object
- TinValid::GreeceTin
- Defined in:
- lib/tin_valid/greece_tin.rb
Instance Attribute Summary collapse
-
#tin ⇒ Object
readonly
Returns the value of attribute tin.
Instance Method Summary collapse
-
#initialize(tin:) ⇒ GreeceTin
constructor
A new instance of GreeceTin.
- #valid? ⇒ Boolean
Constructor Details
#initialize(tin:) ⇒ GreeceTin
Returns a new instance of GreeceTin.
5 6 7 |
# File 'lib/tin_valid/greece_tin.rb', line 5 def initialize(tin:) @tin = tin end |
Instance Attribute Details
#tin ⇒ Object (readonly)
Returns the value of attribute tin.
9 10 11 |
# File 'lib/tin_valid/greece_tin.rb', line 9 def tin @tin end |
Instance Method Details
#valid? ⇒ Boolean
11 12 13 14 15 |
# File 'lib/tin_valid/greece_tin.rb', line 11 def valid? return false unless /\A[0-9]{9}\z/.match?(tin) tin != "000000000" && tin != "123456789" end |