class Dpl::Provider::Status
Constants
- MSG
- STATUS
- URL
Public Class Methods
Source
# File lib/dpl/provider/status.rb, line 18 def initialize(provider, status, info) unknown!(status) unless known?(status) super end
Calls superclass method
Public Instance Methods
Source
# File lib/dpl/provider/status.rb, line 27 def msg msg = (MSG[status] % name).to_s msg << "(#{info})" if info msg << ". #{MSG[:pre_stable] % URL}" if pre_stable? msg end
Private Instance Methods
Source
# File lib/dpl/provider/status.rb, line 48 def deprecated? status == :deprecated end
Source
# File lib/dpl/provider/status.rb, line 52 def known?(status) STATUS.include?(status) end
Source
# File lib/dpl/provider/status.rb, line 40 def pre_stable? STATUS.index(status) < STATUS.index(:stable) end
Source
# File lib/dpl/provider/status.rb, line 56 def unknown!(status) raise "Unknown status: #{status.inspect}. Known statuses are: #{STATUS.map(&:inspect).join(', ')}" end