Class: BillerBotResource::Product::Context

Inherits:
Resource
  • Object
show all
Defined in:
lib/biller_bot_resource/product.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#cache_key, config, configure, #initialize, instantiate_collection, query_string, #save

Constructor Details

This class inherits a constructor from BillerBotResource::Resource

Instance Attribute Details

#product_idObject

Returns the value of attribute product_id.



6
7
8
# File 'lib/biller_bot_resource/product.rb', line 6

def product_id
  @product_id
end

Instance Method Details

#force_persistedObject

ActiveResource treats our nested models as non-persisted models. We make this little hack so that the contexts can be loaded with the product, but saved independently.



16
17
18
# File 'lib/biller_bot_resource/product.rb', line 16

def force_persisted
  @persisted = true
end

#prefix_optionsObject



8
9
10
# File 'lib/biller_bot_resource/product.rb', line 8

def prefix_options
  { :product_id => product_id }
end