Skip to content

Commit

Permalink
🐛 fix fo no fest
Browse files Browse the repository at this point in the history
  • Loading branch information
YutaGoto committed Feb 21, 2024
1 parent a099df8 commit 81ab2e8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/ika3/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,29 @@ class Battle
attr_reader :start_time, :end_time, :rule, :stages, :is_fest

def initialize(data)
@start_time = data['start_time']
@end_time = data['end_time']
@rule = Rule.new(data['rule'])
@stages = data['stages'].map { |stage| Stage.new(stage) }
@is_fest = data['is_fest']
@start_time = data&.[](:start_time)
@end_time = data&.[](:end_time)
@rule = Rule.new(data&.[](:rule))
@stages = data&.[](:stages)&.map { |stage| Stage.new(stage) }
@is_fest = data&.[](:is_fest)
end

class Stage
attr_reader :id, :name, :image

def initialize(data)
@id = data['id']
@name = data['name']
@image = data['image']
@id = data&.[](:id)
@name = data&.[](:name)
@image = data&.[](:image)
end
end

class Rule
attr_reader :name, :key

def initialize(data)
@name = data['name']
@key = data['key']
@name = data&.[](:name)
@key = data&.[](:key)
end
end

Expand Down

0 comments on commit 81ab2e8

Please sign in to comment.