Class: FlexCommerce::StaticPage
- Inherits:
-
FlexCommerceApi::ApiBase
- Object
- JsonApiClient::Resource
- FlexCommerceApi::BaseResource
- FlexCommerceApi::ApiBase
- FlexCommerce::StaticPage
- Defined in:
- app/models/static_page.rb
Overview
A flex commerce Static Page model
This model provides access to the flex commerce static pages. As managing the static pages is the job of the administration panel, this model is read only.
It is used much like an active record model.
Examples:
# Fetching all static pages
FlexCommerce::StaticPage.all #fetches all static pages (actually the first page in case there are thousands)
# Pagination
FlexCommerce::StaticPage.paginate(page:2).all # Fetches page 2 of static pages.
The page size is predefined on the server side
# Finding static pages
FlexCommerce::StaticPage.find(25) # Finds the static page with this unique id
Constant Summary
Constants inherited from FlexCommerceApi::BaseResource
FlexCommerceApi::BaseResource::PRIVATE_ATTRIBUTES, FlexCommerceApi::BaseResource::RELATED_META_RESOURCES
Class Method Summary collapse
Instance Method Summary collapse
-
#all ⇒ FlexCommerce::StaticPage[]
Returns all static pages.
-
#find ⇒ FlexCommerce::Product
Finds a static page.
-
#paginate ⇒ Object
Paginates the list of static pages by a preset page size.
Methods inherited from FlexCommerceApi::ApiBase
Methods inherited from FlexCommerceApi::BaseResource
all, append_version, #as_json_api, capture_surrogate_keys, create!, endpoint_version, find, find_all, #freeze, #initialize, load, #meta_attribute, #method_missing, paginate, password, #public_attributes, reconfigure, reconfigure_all, reconfigure_api_base, reload_connection_if_required, #save!, username
Constructor Details
This class inherits a constructor from FlexCommerceApi::BaseResource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class FlexCommerceApi::BaseResource
Class Method Details
.path(params, *args) ⇒ Object
55 56 57 |
# File 'app/models/static_page.rb', line 55 def path(params, *args) super end |
Instance Method Details
#all ⇒ FlexCommerce::StaticPage[]
Returns all static pages
|
# File 'app/models/static_page.rb', line 37
|
#paginate ⇒ Object
Paginates the list of static pages by a preset page size
46 |
# File 'app/models/static_page.rb', line 46 has_many :slugs, class_name: "::FlexCommerce::Slug" |