Class: RedTape::Validators::DE
- Inherits:
-
RedTape::Validator
- Object
- RedTape::Validator
- RedTape::Validators::DE
- Defined in:
- lib/red_tape/validators/de.rb
Constant Summary collapse
- API_BASE =
'https://api.evatr.vies.bzst.de/app/v1'.freeze
- QUERY_URL =
"#{API_BASE}/abfrage".freeze
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#other ⇒ Object
readonly
Returns the value of attribute other.
-
#own ⇒ Object
readonly
Returns the value of attribute own.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(own, other, options = {}) ⇒ DE
constructor
A new instance of DE.
- #result ⇒ Object
- #status_code ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(own, other, options = {}) ⇒ DE
Returns a new instance of DE.
11 12 13 |
# File 'lib/red_tape/validators/de.rb', line 11 def initialize(own, other, = {}) @own, @other, @options = own, other, end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/red_tape/validators/de.rb', line 7 def @options end |
#other ⇒ Object (readonly)
Returns the value of attribute other.
7 8 9 |
# File 'lib/red_tape/validators/de.rb', line 7 def other @other end |
#own ⇒ Object (readonly)
Returns the value of attribute own.
7 8 9 |
# File 'lib/red_tape/validators/de.rb', line 7 def own @own end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/red_tape/validators/de.rb', line 7 def status @status end |
Class Method Details
.country ⇒ Object
9 |
# File 'lib/red_tape/validators/de.rb', line 9 def self.country; 'DE'; end |
Instance Method Details
#result ⇒ Object
15 16 17 |
# File 'lib/red_tape/validators/de.rb', line 15 def result @result ||= {} end |
#status_code ⇒ Object
19 20 21 |
# File 'lib/red_tape/validators/de.rb', line 19 def status_code result['status'] end |
#valid? ⇒ Boolean
23 24 25 26 27 |
# File 'lib/red_tape/validators/de.rb', line 23 def valid? validate rescue => e raise ValidationError.new(e) end |