Class: FlexCommerce::Menu

Inherits:
FlexCommerceApi::ApiBase show all
Defined in:
app/models/menu.rb

Overview

A flex commerce Menu model

This model provides access to the flex commerce menus. As managing the menus is the job of the administration panel, this model is read only.

It is used much like an active record model.

Examples:

# Fetching all menus

FlexCommerce::Menu.all #fetches all menus(actually the first page in case there are thousands)

# Finding a specific menu

FlexCommerce::Menu.find("my-menu-reference") # Finds the menu with this unique id

# Finding nested menu items of the menu (See MenuItem class for what you can do with this including getting nested menu items)

FlexCommerce::Menu.find("my-product-slug").menu_items

Constant Summary

Constants inherited from FlexCommerceApi::BaseResource

FlexCommerceApi::BaseResource::PRIVATE_ATTRIBUTES, FlexCommerceApi::BaseResource::RELATED_META_RESOURCES

Class 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 = nil, record = nil) ⇒ Object

This model has a path attribute so path can no longer be used to modify the path



32
33
34
# File 'app/models/menu.rb', line 32

def self.path(params = nil, record = nil)
  super(params.nil? ? nil : params.except("path"), record)
end