Class: NewsStand::Validator
- Inherits:
-
Object
- Object
- NewsStand::Validator
- Defined in:
- lib/news_stand/validator.rb
Constant Summary collapse
- REQUIRED_METHODS =
[:all, :get, :set]
Instance Method Summary collapse
-
#initialize(adapter) ⇒ Validator
constructor
A new instance of Validator.
- #valid? ⇒ Boolean
Constructor Details
#initialize(adapter) ⇒ Validator
Returns a new instance of Validator.
5 6 7 |
# File 'lib/news_stand/validator.rb', line 5 def initialize(adapter) @adapter = adapter end |
Instance Method Details
#valid? ⇒ Boolean
9 10 11 12 13 14 |
# File 'lib/news_stand/validator.rb', line 9 def valid? REQUIRED_METHODS.each do |meth| return false unless @adapter.instance_methods.include?(meth) end true end |