Class: MetalArchives::Label

Inherits:
Base
  • Object
show all
Defined in:
lib/metal_archives/models/label.rb

Overview

Represents a record label

Class Method Summary collapse

Instance Method Summary collapse

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

#addressObject

: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

#contactObject

: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

#countryObject

: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_foundedObject

: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

#idObject

:attr_reader: id

Returns Integer



16
# File 'lib/metal_archives/models/label.rb', line 16

property :id, type: Integer

#nameObject

: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_shoppingObject

:attr_reader: online_shopping

Returns Boolean



96
# File 'lib/metal_archives/models/label.rb', line 96

boolean :online_shopping

#phoneObject

: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

#specializationsObject

: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

#statusObject

: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_labelsObject

: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