Class: PoolParty::Verify
Instance Method Summary collapse
-
#constantize(name, base_object = Monitors) ⇒ Object
Take a string and return a ruby object if a match is found in the base_objects namespace.
-
#initialize(&block) ⇒ Verify
constructor
A new instance of Verify.
- #method_missing(m, *a, &block) ⇒ Object
-
#passing? ⇒ Boolean
Check in with the verifiers and make sure they are all passing?.
- #verifiers ⇒ Object
Constructor Details
#initialize(&block) ⇒ Verify
Returns a new instance of Verify.
42 43 44 45 46 |
# File 'lib/poolparty/verification/verify.rb', line 42 def initialize(&block) ::PoolParty.require_user_directory "verifiers" instance_eval &block if block end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
Instance Method Details
#constantize(name, base_object = Monitors) ⇒ Object
Take a string and return a ruby object if a match is found in the base_objects namespace.
56 57 58 59 60 61 62 63 64 |
# File 'lib/poolparty/verification/verify.rb', line 56 def constantize(name, base_object=Monitors) begin const = base_object.constants.find{|cnst| cnst == name.camelcase } base_object.module_eval const rescue Exception => e puts "#{name.camelcase} is not defined. #{e}" nil end end |
#passing? ⇒ Boolean
Check in with the verifiers and make sure they are all passing?
51 52 53 |
# File 'lib/poolparty/verification/verify.rb', line 51 def passing? verifiers.each {|v| raise "Not working" unless v.passing? } end |
#verifiers ⇒ Object
48 |
# File 'lib/poolparty/verification/verify.rb', line 48 def verifiers;@verifiers ||= [];end |