Class: Bishl::ScheduleLine
- Inherits:
-
Struct
- Object
- Struct
- Bishl::ScheduleLine
- Defined in:
- lib/schedule_line.rb
Instance Attribute Summary collapse
-
#position ⇒ Object
Returns the value of attribute position.
-
#team ⇒ Object
Returns the value of attribute team.
Instance Method Summary collapse
-
#initialize ⇒ ScheduleLine
constructor
A new instance of ScheduleLine.
- #method_missing(method, *arguments, &block) ⇒ Object
Constructor Details
#initialize ⇒ ScheduleLine
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
#position ⇒ Object
Returns the value of attribute position
2 3 4 |
# File 'lib/schedule_line.rb', line 2 def position @position end |
#team ⇒ Object
Returns the value of attribute team.
4 5 6 |
# File 'lib/schedule_line.rb', line 4 def team @team end |