Class: FlexCommerce::StaticPage

Inherits:
FlexCommerceApi::ApiBase show all
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

Methods inherited from FlexCommerceApi::ApiBase

endpoint_version

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

#allFlexCommerce::StaticPage[]

Returns all static pages

Returns:



# File 'app/models/static_page.rb', line 37

#findFlexCommerce::Product

Finds a static page

Parameters:

  • spec (String)

Returns:

Raises:



# File 'app/models/static_page.rb', line 31

#paginateObject

Paginates the list of static pages by a preset page size

Parameters:

  • options (Hash)

    The options to paginate with

  • options (Numeric|String)

    :page The page to fetch



46
# File 'app/models/static_page.rb', line 46

has_many :slugs, class_name: "::FlexCommerce::Slug"