class PlaylyfeClient::V2::TeamCollection
Public Class Methods
new(game)
click to toggle source
Calls superclass method
PlaylyfeClient::V2::Collection::new
# File lib/playlyfe_client/v2/collection/team_collection.rb, line 14 def initialize(game) super @items=[] fill_items(@game.connection.get_team_hash_array) end
Public Instance Methods
find(str)
click to toggle source
# File lib/playlyfe_client/v2/collection/team_collection.rb, line 8 def find(str) (@items.detect {|pl| pl.name == str || pl.id == str}) end
Private Instance Methods
fill_items(hash_array)
click to toggle source
# File lib/playlyfe_client/v2/collection/team_collection.rb, line 20 def fill_items(hash_array) hash_array.each do |item_hash| @items << PlaylyfeClient::V2::Team.new(item_hash, @game) end end