Class: Bishl::ScheduleLine

Inherits:
Struct
  • Object
show all
Defined in:
lib/schedule_line.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScheduleLine

Returns a new instance of ScheduleLine.



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

def initialize
  @team = ScheduleTeam.new
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *arguments, &block) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/schedule_line.rb', line 10

def method_missing(method, *arguments, &block)
  #puts method.to_s
  match = method.to_s =~/create_/
  #puts match
  if match
    name = method.to_s.split("_")[1]

    if(name=="position")
      self.send("position=", arguments.pop)
    else
      @team.send("#{name}=", arguments.pop)
    end
  else
    super
  end
end

Instance Attribute Details

#positionObject

Returns the value of attribute position

Returns:

  • (Object)

    the current value of position



2
3
4
# File 'lib/schedule_line.rb', line 2

def position
  @position
end

#teamObject

Returns the value of attribute team.



4
5
6
# File 'lib/schedule_line.rb', line 4

def team
  @team
end