Class: Hockey::Team

Inherits:
Object
  • Object
show all
Defined in:
lib/hockeyhelper/team.rb

Overview

Team on HockeyApp

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hashobj, networking) ⇒ Team

Returns a new instance of Team


16
17
18
19
20
21
# File 'lib/hockeyhelper/team.rb', line 16

def initialize(hashobj, networking)
  @id = hashobj['id']
  @name = hashobj['name']
  @original_hash = hashobj
  @net = networking
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id


6
7
8
# File 'lib/hockeyhelper/team.rb', line 6

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name


7
8
9
# File 'lib/hockeyhelper/team.rb', line 7

def name
  @name
end

#netObject (readonly)

Returns the value of attribute net


10
11
12
# File 'lib/hockeyhelper/team.rb', line 10

def net
  @net
end

#original_hashObject (readonly)

Returns the value of attribute original_hash


8
9
10
# File 'lib/hockeyhelper/team.rb', line 8

def original_hash
  @original_hash
end

Class Method Details

.create_from(hashobj, networking) ⇒ Object


12
13
14
# File 'lib/hockeyhelper/team.rb', line 12

def self.create_from(hashobj, networking)
  self.new hashobj, networking
end

Instance Method Details

#inspectObject Also known as: to_s


23
24
25
# File 'lib/hockeyhelper/team.rb', line 23

def inspect
  "#<#{self.class}:#{'0x%08x' % self.hash} #{@id}, #{@name}>"
end