Sha256: 442ef2fd14ce56b3ed0215f6a9434e25c162f8399e7248c4b602b38826f48f68
Contents?: true
Size: 683 Bytes
Versions: 10
Compression:
Stored size: 683 Bytes
Contents
require_relative "../collection.rb" require_relative "../player.rb" module PlaylyfeClient module V2 class PlayerCollection < PlaylyfeClient::V2::Collection def find(str) (@items.detect {|pl| pl.alias.include?(str) || pl.id.include?(str)}) end private def initialize(game) super @items=[] fill_items(@game.connection.get_player_hash_array) end def fill_items(player_hash_array) player_hash_array.each do |player_hash| @items << PlaylyfeClient::V2::Player.new(player_hash, @game) end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems