Skip to content

Commit

Permalink
Remove ScheduleMetadata, which must be unused
Browse files Browse the repository at this point in the history
  • Loading branch information
nurse committed Nov 30, 2015
1 parent 9d6c0a2 commit a0e0323
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lib/perfectsched/backend/rdb_compat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def get_schedule_metadata(key, options={})
raise NotFoundError, "schedule key=#{key} does not exist"
end
attributes = create_attributes(row)
return ScheduleMetadata.new(@client, key, attributes)
return ScheduleWithMetadata.new(@client, key, attributes)
}
end

Expand Down
20 changes: 0 additions & 20 deletions lib/perfectsched/schedule_metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,24 +57,4 @@ def message
@attributes[:message]
end
end

class ScheduleMetadata
include Model

def initialize(client, key, attributes)
super(client)
@key = key
end

def schedule
Schedule.new(@client, @key)
end

def inspect
"#<#{self.class} @key=#{@key.inspect} @attributes=#{@attributes.inspect}>"
end

include ScheduleMetadataAccessors
end

end
2 changes: 1 addition & 1 deletion spec/rdb_compat_backend_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
db.add('key', 'test', '* * * * *', 0, 'Asia/Tokyo', {}, now, now, {})
end
it 'fetches a metadata' do
expect(db.get_schedule_metadata('key')).to be_an_instance_of(ScheduleMetadata)
expect(db.get_schedule_metadata('key')).to be_an_instance_of(ScheduleWithMetadata)
end
it 'raises error if non exist key' do
expect{db.get_schedule_metadata('nonexistent')}.to raise_error(NotFoundError)
Expand Down

0 comments on commit a0e0323

Please sign in to comment.