Class: PoolParty::Verify
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
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.
48 49 50 51 52 |
# File 'lib/poolparty/verification/verify.rb', line 48 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 Attribute Details
#host ⇒ Object
Returns the value of attribute host.
47 48 49 |
# File 'lib/poolparty/verification/verify.rb', line 47 def host @host end |
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.
62 63 64 65 66 67 68 69 70 |
# File 'lib/poolparty/verification/verify.rb', line 62 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?
57 58 59 |
# File 'lib/poolparty/verification/verify.rb', line 57 def passing? verifiers.each {|v| raise "Not working" unless v.passing? } end |
#verifiers ⇒ Object
54 |
# File 'lib/poolparty/verification/verify.rb', line 54 def verifiers;@verifiers ||= [];end |