Class: Sports::Round

Inherits:
Object
  • Object
show all
Defined in:
lib/sports/structs/round.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, num: nil, start_date: nil, end_date: nil, knockout: false, auto: true) ⇒ Round

Returns a new instance of Round.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/sports/structs/round.rb', line 7

def initialize( name:,
                num: nil,
                start_date: nil,
                end_date: nil,
                knockout: false,
                auto: true )
  @name       = name
  @num        = num
  @start_date = start_date
  @end_date   = end_date
  @knockout   = knockout
  @auto       = auto        # auto-created (inline reference/header without proper definition before)
end

Instance Attribute Details

#end_dateObject (readonly)

Returns the value of attribute end_date.



4
5
6
# File 'lib/sports/structs/round.rb', line 4

def end_date
  @end_date
end

#knockoutObject (readonly)

Returns the value of attribute knockout.



4
5
6
# File 'lib/sports/structs/round.rb', line 4

def knockout
  @knockout
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/sports/structs/round.rb', line 4

def name
  @name
end

#numObject

note: make read & writable - why? why not?



5
6
7
# File 'lib/sports/structs/round.rb', line 5

def num
  @num
end

#start_dateObject (readonly)

Returns the value of attribute start_date.



4
5
6
# File 'lib/sports/structs/round.rb', line 4

def start_date
  @start_date
end