Class: CardDB::Publisher

Inherits:
Resource show all
Defined in:
lib/carddb/collection.rb

Overview

Wrapper for Publisher objects

Instance Attribute Summary

Attributes inherited from Resource

#client, #data

Instance Method Summary collapse

Methods inherited from Resource

#[], #initialize, #key?, #to_h, #to_json

Constructor Details

This class inherits a constructor from CardDB::Resource

Instance Method Details



291
292
293
# File 'lib/carddb/collection.rb', line 291

def banner_url
  data.dig('bannerFile', 'url')
end

#created_atObject



295
296
297
# File 'lib/carddb/collection.rb', line 295

def created_at
  parse_time(data['createdAt'])
end

#descriptionObject



274
275
276
# File 'lib/carddb/collection.rb', line 274

def description
  data['description']
end

#gamesCollection<Game>

Fetch games belonging to this publisher. Results are cached after the first call.

Returns:

Raises:



308
309
310
# File 'lib/carddb/collection.rb', line 308

def games
  @games ||= fetch_games
end

#idObject



262
263
264
# File 'lib/carddb/collection.rb', line 262

def id
  data['id']
end

#logo_urlObject



287
288
289
# File 'lib/carddb/collection.rb', line 287

def logo_url
  data.dig('logoFile', 'url')
end

#nameObject



266
267
268
# File 'lib/carddb/collection.rb', line 266

def name
  data['name']
end

#slugObject



270
271
272
# File 'lib/carddb/collection.rb', line 270

def slug
  data['slug']
end

#statusString

Returns Publisher status (‘ACTIVE` or `DEACTIVATED`).

Returns:

  • (String)

    Publisher status (‘ACTIVE` or `DEACTIVATED`)



283
284
285
# File 'lib/carddb/collection.rb', line 283

def status
  data['status']
end

#updated_atObject



299
300
301
# File 'lib/carddb/collection.rb', line 299

def updated_at
  parse_time(data['updatedAt'])
end

#websiteObject



278
279
280
# File 'lib/carddb/collection.rb', line 278

def website
  data['website']
end