class OptionsHash::Option

Attributes

default[R]

Public Class Methods

new(required, default=nil) click to toggle source
# File lib/options_hash.rb, line 6
def initialize required, default=nil
  @required, @default = !!required, default
end

Public Instance Methods

has_default?() click to toggle source
# File lib/options_hash.rb, line 11
def has_default?
  !!default
end
has_default_proc?() click to toggle source
# File lib/options_hash.rb, line 14
def has_default_proc?
  default.is_a? Proc
end
inspect() click to toggle source
# File lib/options_hash.rb, line 17
def inspect
  %(#{required? ? 'required' : 'optional'} #{default ? 'with' : 'without'} default)
end
Also aliased as: to_s
required?() click to toggle source
# File lib/options_hash.rb, line 9
def required?; @required; end
to_s()
Alias for: inspect