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



281
282
283
# File 'lib/carddb/collection.rb', line 281

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

#created_atObject



285
286
287
# File 'lib/carddb/collection.rb', line 285

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

#descriptionObject



264
265
266
# File 'lib/carddb/collection.rb', line 264

def description
  data['description']
end

#gamesCollection<Game>

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

Returns:

Raises:



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

def games
  @games ||= fetch_games
end

#idObject



252
253
254
# File 'lib/carddb/collection.rb', line 252

def id
  data['id']
end

#logo_urlObject



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

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

#nameObject



256
257
258
# File 'lib/carddb/collection.rb', line 256

def name
  data['name']
end

#slugObject



260
261
262
# File 'lib/carddb/collection.rb', line 260

def slug
  data['slug']
end

#statusString

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

Returns:

  • (String)

    Publisher status (‘ACTIVE` or `DEACTIVATED`)



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

def status
  data['status']
end

#updated_atObject



289
290
291
# File 'lib/carddb/collection.rb', line 289

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

#websiteObject



268
269
270
# File 'lib/carddb/collection.rb', line 268

def website
  data['website']
end