Class: Lipseys::Inventory
Overview
Each method will return an array of inventory items with the following fields:
{
item_number: content_for(item, 'ItemNo'),
upc: content_for(item, 'UPC'),
manufacturer_model_number: content_for(item, 'MFGModelNo'),
quantity_on_hand: content_for(item, 'QtyOnHand'),
allocation: (content_for(item, 'Allocation') == 'Y'),
price: content_for(item, 'Price'),
on_sale: (content_for(item, 'OnSale') == 'Y'),
retail_map: content_for(item, 'RetailMAP')
}
Constant Summary collapse
- API_URL =
'https://www.lipseys.com/API/pricequantitycatalog.ashx'
Class Method Summary collapse
- .accessories(options = {}) ⇒ Object
- .all(options = {}) ⇒ Object
- .firearms(options = {}) ⇒ Object
- .nfa(options = {}) ⇒ Object
- .optics(options = {}) ⇒ Object
Instance Method Summary collapse
- #accessories ⇒ Object
- #all ⇒ Object
- #firearms ⇒ Object
-
#initialize(options = {}) ⇒ Inventory
constructor
A new instance of Inventory.
- #nfa ⇒ Object
- #optics ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Inventory
Returns a new instance of Inventory.
19 20 21 22 23 |
# File 'lib/lipseys/inventory.rb', line 19 def initialize( = {}) requires!(, :email, :password) @email = [:email] @password = [:password] end |
Class Method Details
.accessories(options = {}) ⇒ Object
58 59 60 |
# File 'lib/lipseys/inventory.rb', line 58 def self.accessories( = {}) new().accessories end |
.all(options = {}) ⇒ Object
26 27 28 |
# File 'lib/lipseys/inventory.rb', line 26 def self.all( = {}) new().all end |
.firearms(options = {}) ⇒ Object
34 35 36 |
# File 'lib/lipseys/inventory.rb', line 34 def self.firearms( = {}) new().firearms end |
.nfa(options = {}) ⇒ Object
42 43 44 |
# File 'lib/lipseys/inventory.rb', line 42 def self.nfa( = {}) new().nfa end |
.optics(options = {}) ⇒ Object
50 51 52 |
# File 'lib/lipseys/inventory.rb', line 50 def self.optics( = {}) new().optics end |
Instance Method Details
#accessories ⇒ Object
62 63 64 |
# File 'lib/lipseys/inventory.rb', line 62 def accessories get_items('ACCESSORY') end |
#all ⇒ Object
30 31 32 |
# File 'lib/lipseys/inventory.rb', line 30 def all get_items end |
#firearms ⇒ Object
38 39 40 |
# File 'lib/lipseys/inventory.rb', line 38 def firearms get_items('FIREARM') end |
#nfa ⇒ Object
46 47 48 |
# File 'lib/lipseys/inventory.rb', line 46 def nfa get_items('NFA') end |
#optics ⇒ Object
54 55 56 |
# File 'lib/lipseys/inventory.rb', line 54 def optics get_items('OPTIC') end |