Class: MetalArchives::Label
- Defined in:
- lib/metal_archives/models/label.rb
Overview
Represents a record label
Class Method Summary collapse
-
.find_by_name(name, id) ⇒ Object
Find by name and id.
-
.search(_name) ⇒ Object
Search by name.
Instance Method Summary collapse
-
#address ⇒ Object
:attr_reader: address.
-
#contact ⇒ Object
:attr_reader: contact.
-
#country ⇒ Object
:attr_reader: country.
-
#date_founded ⇒ Object
:attr_reader: date_founded.
-
#id ⇒ Object
:attr_reader: id.
-
#name ⇒ Object
:attr_reader: name.
-
#online_shopping ⇒ Object
:attr_reader: online_shopping.
-
#phone ⇒ Object
:attr_reader: phone.
-
#specializations ⇒ Object
:attr_reader: specializations.
-
#status ⇒ Object
:attr_reader: status.
-
#sub_labels ⇒ Object
:attr_reader: sub_labels.
Methods inherited from Base
#==, cache, #cached?, #initialize, #inspect, #load!, #loaded?, properties, #set
Constructor Details
This class inherits a constructor from MetalArchives::Base
Class Method Details
.find_by_name(name, id) ⇒ Object
Find by name and id.
Returns Label
127 128 129 130 131 132 133 |
# File 'lib/metal_archives/models/label.rb', line 127 def find_by_name(name, id) client.find_resource( :band, name: name, id: id, ) end |
.search(_name) ⇒ Object
Search by name.
Returns Array
of Label
118 119 120 |
# File 'lib/metal_archives/models/label.rb', line 118 def search(_name) [] end |
Instance Method Details
#address ⇒ Object
:attr_reader: address
Returns multiline String
- Raises
-
MetalArchives::Errors::InvalidIDError when no or invalid id
-
MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
38 |
# File 'lib/metal_archives/models/label.rb', line 38 property :address |
#contact ⇒ Object
:attr_reader: contact
Returns Hash
with the following keys: title
, content
103 |
# File 'lib/metal_archives/models/label.rb', line 103 property :contact, type: Hash, multiple: true |
#country ⇒ Object
:attr_reader: country
Returns ISO316::Country
- Raises
-
MetalArchives::Errors::InvalidIDError when no or invalid id
-
MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
49 |
# File 'lib/metal_archives/models/label.rb', line 49 property :country, type: ISO3166::Country |
#date_founded ⇒ Object
:attr_reader: date_founded
Returns Date
- Raises
-
MetalArchives::Errors::InvalidIDError when no or invalid id
-
MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
82 |
# File 'lib/metal_archives/models/label.rb', line 82 property :date_founded, type: Date |
#id ⇒ Object
:attr_reader: id
Returns Integer
16 |
# File 'lib/metal_archives/models/label.rb', line 16 property :id, type: Integer |
#name ⇒ Object
:attr_reader: name
Returns String
- Raises
-
MetalArchives::Errors::InvalidIDError when no or invalid id
-
MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
27 |
# File 'lib/metal_archives/models/label.rb', line 27 property :name |
#online_shopping ⇒ Object
:attr_reader: online_shopping
Returns Boolean
96 |
# File 'lib/metal_archives/models/label.rb', line 96 boolean :online_shopping |
#phone ⇒ Object
:attr_reader: phone
Returns String
- Raises
-
MetalArchives::Errors::InvalidIDError when no or invalid id
-
MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
60 |
# File 'lib/metal_archives/models/label.rb', line 60 property :phone |
#specializations ⇒ Object
:attr_reader: specializations
Returns Array
of String
- Raises
-
MetalArchives::Errors::InvalidIDError when no or invalid id
-
MetalArchives::Errors::APIError when receiving a status code >= 400 (except 404)
71 |
# File 'lib/metal_archives/models/label.rb', line 71 property :specializations, multiple: true |
#status ⇒ Object
:attr_reader: status
Returns :active
, :closed
or :unknown
110 |
# File 'lib/metal_archives/models/label.rb', line 110 enum :status, values: [:active, :closed, :unknown] |
#sub_labels ⇒ Object
:attr_reader: sub_labels
Returns Array
of Label
89 |
# File 'lib/metal_archives/models/label.rb', line 89 property :sub_labels, type: Label, multiple: true |