Class: Fog::Openstack::Planning::Plans

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/openstack/models/planning/plans.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *arguments, &block) ⇒ Object



19
20
21
22
23
24
25
26
27
# File 'lib/fog/openstack/models/planning/plans.rb', line 19

def method_missing(method_sym, *arguments, &block)
  if method_sym.to_s =~ /^find_by_(.*)$/
    self.all.find do |plan|
      plan.send($1) == arguments.first
    end
  else
    super
  end
end

Instance Method Details

#allObject



10
11
12
# File 'lib/fog/openstack/models/planning/plans.rb', line 10

def all
  load(service.list_plans.body)
end

#find_by_uuid(plan_uuid) ⇒ Object Also known as: get



14
15
16
# File 'lib/fog/openstack/models/planning/plans.rb', line 14

def find_by_uuid(plan_uuid)
  new(service.get_plan(plan_uuid).body)
end