Class: Frulo::Plan

Inherits:
Resource show all
Defined in:
lib/frulo.rb

Class Method Summary collapse

Methods inherited from Resource

#id, #initialize, #method_missing

Constructor Details

This class inherits a constructor from Frulo::Resource

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Frulo::Resource

Class Method Details

.allObject



81
82
83
84
# File 'lib/frulo.rb', line 81

def self.all
  request = Frulo.get("/plans.xml")
  request['plans'].collect{|data| Plan.new(data)}
end

.find(id) ⇒ Object



86
87
88
89
# File 'lib/frulo.rb', line 86

def self.find(id)
  request = all
  request.detect{ |p| p.id.to_s == id.to_s }
end