Class: IronBank::Resources::ProductRatePlan

Inherits:
IronBank::Resource show all
Defined in:
lib/iron_bank/resources/product_rate_plan.rb

Overview

A product rate plan belongs to a product and holds many product rate plan charges. It represents what a customer is subscribing to.

Instance Attribute Summary

Attributes inherited from IronBank::Resource

#remote

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from IronBank::Resource

#==, #id, #initialize, #inspect, object_name, #reload, #remove_instance_vars, with_cache, with_local_records

Methods included from Associations::ClassMethods

#with_many, #with_one

Methods included from Metadata

#excluded_fields, #fields, #query_custom_fields, #query_fields, #reset, #schema, #single_resource_query_fields, #with_schema

Methods included from Queryable

#all, #find, #find_each, #first, #where

Methods included from Associations

#with_memoization

Constructor Details

This class inherits a constructor from IronBank::Resource

Class Method Details

.excluded_fieldsObject

NOTE: Zuora doesn’t let us query for more than one product rate plan

`ActiveCurrencies` at a time


11
12
13
# File 'lib/iron_bank/resources/product_rate_plan.rb', line 11

def self.excluded_fields
  super + single_resource_query_fields
end

.single_resource_query_fieldsObject



15
16
17
# File 'lib/iron_bank/resources/product_rate_plan.rb', line 15

def self.single_resource_query_fields
  %w[ActiveCurrencies]
end

Instance Method Details

#active_currenciesObject



26
27
28
29
30
31
32
33
34
# File 'lib/iron_bank/resources/product_rate_plan.rb', line 26

def active_currencies
  query_string = IronBank::QueryBuilder.zoql(
    self.class.object_name,
    ["ActiveCurrencies"],
    id: id
  )

  IronBank.client.query(query_string)
end