Class: Mousetrap::Plan

Inherits:
Resource show all
Defined in:
lib/mousetrap/plan.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from Resource

[], #destroy, destroy_all, exists?, #exists?, #initialize, #new?, new_from_api

Constructor Details

This class inherits a constructor from Mousetrap::Resource

Instance Attribute Details

#codeObject

Returns the value of attribute code.



3
4
5
# File 'lib/mousetrap/plan.rb', line 3

def code
  @code
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/mousetrap/plan.rb', line 3

def name
  @name
end

Class Method Details

.allObject



7
8
9
10
11
# File 'lib/mousetrap/plan.rb', line 7

def self.all
  response = get_resources plural_resource_name
  return [] unless response['plans']
  build_resources_from response
end