Skip to content

probes.active throws an error if active == false #5

@rberger

Description

@rberger

It seems that if you get the list of probes using Pingdom::Probe and a probe listing has "active" => false, the method missing look up fails. I could not figure out why myself.

Here's an example. It turned ou in my case the first probe had actve set to false, the second probe had it true. So when I try to access the active method on the first one, I get an exception, but I can access all the other attributes/methods fine. Here I show accessing the ip method and then failing on active.

client = Pingdom::Client.new :username => u, :password => p, :key => k
probes = client.probes

puts probes[0].inspect #=> #<Pingdom::Probe id: 17 country: "Sweden" city: "Stockholm" name: "Stockholm, Sweden" active: false hostname: "s238.pingdom.com" ip: "83.140.19.38" countryiso: "SE">

puts probes[0].ip #=> 83.140.19.38


puts probes[0].active #=> NoMethodError: undefined method `active' for #<Pingdom::Probe:0x000001022eb0f0>
    from /Users/rberger/.rvm/gems/ruby-1.9.2-p290/gems/pingdom-client-0.0.6.alpha/lib/pingdom/base.rb:26:in `method_missing'
    from (irb):32
    from /Users/rberger/.rvm/rubies/ruby-1.9.2-p290/bin/irb:16:in `<main>'

And on the second probe where active is true I can access all the attributes including active:


puts probes[1].inspect #=> #<Pingdom::Probe id: 21 country: "Canada" city: "Montreal" name: "Montreal, Canada" active: true hostname: "s34.pingdom.com" ip: "67.205.112.79" countryiso: "CA">

puts probes[1].ip #=> 67.205.112.79

puts probes[1].active #=> true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions