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

#itemsObject

Returns the value of attribute items.



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

def items
  @items
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#recurring_charge_amountObject

Returns the value of attribute recurring_charge_amount.



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

def recurring_charge_amount
  @recurring_charge_amount
end

Class Method Details

.allObject



9
10
11
12
13
# File 'lib/mousetrap/plan.rb', line 9

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