Class: Etsy::Shop
Overview
Shop
Represents a single Etsy shop. Users may or may not have an associated shop.
A shop has the following attributes:
- name
-
The shop’s name
- title
-
A brief heading for the shop’s main page
- announcement
-
An announcement to buyers (displays on the shop’s home page)
- message
-
The message sent to users who buy from this shop
- image_url
-
The full URL to the shops’s banner image
- active_listings_count
-
The number of active listings present in this shop
- url
-
The full URL to the shop on Etsy
- favorers_count
-
Number of favorers
Class Method Summary collapse
-
.all(options = {}) ⇒ Object
Retrieve a list of all shops.
-
.find(*identifiers_and_options) ⇒ Object
Retrieve one or more shops by name or ID:.
Instance Method Summary collapse
-
#created_at ⇒ Object
Time that this shop was created.
-
#listings(state = nil, options = {}) ⇒ Object
The collection of listings associated with this shop.
- #sections ⇒ Object
-
#updated_at ⇒ Object
Time that this shop was last updated.
Methods included from Model
included, #initialize, #result, #secret, #token
Class Method Details
.all(options = {}) ⇒ Object
51 52 53 |
# File 'lib/etsy/shop.rb', line 51 def self.all( = {}) self.get_all("/shops", ) end |
.find(*identifiers_and_options) ⇒ Object
42 43 44 |
# File 'lib/etsy/shop.rb', line 42 def self.find(*) self.find_one_or_more('shops', ) end |
Instance Method Details
#created_at ⇒ Object
Time that this shop was created
57 58 59 |
# File 'lib/etsy/shop.rb', line 57 def created_at Time.at(created) end |
#listings(state = nil, options = {}) ⇒ Object
The collection of listings associated with this shop
69 70 71 72 |
# File 'lib/etsy/shop.rb', line 69 def listings(state = nil, = {}) state = state ? {:state => state} : {} Listing.find_all_by_shop_id(id, state.merge().merge(oauth)) end |
#sections ⇒ Object
74 75 76 |
# File 'lib/etsy/shop.rb', line 74 def sections Section.find_by_shop(self) end |
#updated_at ⇒ Object
Time that this shop was last updated
63 64 65 |
# File 'lib/etsy/shop.rb', line 63 def updated_at Time.at(updated) end |