Class: ConfOptions::Bool

Inherits:
Standard
  • Object
show all
Defined in:
lib/confoptions.rb

Instance Method Summary collapse

Methods inherited from Standard

#get, #initialize, #to_pair

Constructor Details

This class inherits a constructor from ConfOptions::Standard

Instance Method Details

#to_sObject


51
52
53
# File 'lib/confoptions.rb', line 51

def to_s
    (self[:env_name] ? self[:env_name] : self[:name] ).to_s.capitalize.gsub('_',' ') + ': ' + self[:value].to_s
end

#validate!(context = ConfSources::Default.new) ⇒ Object


47
48
49
50
# File 'lib/confoptions.rb', line 47

def validate! context = ConfSources::Default.new
    default_validator
    self[:validator].call(self,context) if self[:validator].is_a? Proc
end