Class: OptionClass

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

Direct Known Subclasses

NoneClass, SomeClass

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.[](type) ⇒ Object



68
69
70
# File 'lib/option.rb', line 68

def [](type)
  OptionHelpers::OptionType.for_class(type)
end

Instance Method Details

#==(that) ⇒ Object



73
74
75
76
77
78
# File 'lib/option.rb', line 73

def ==(that)
  case that
    when OptionClass then or_nil == that.or_nil
    else or_nil == that
  end
end

#match {|matcher| ... } ⇒ Object

Yields:

  • (matcher)


80
81
82
83
84
# File 'lib/option.rb', line 80

def match
  matcher = OptionHelpers::OptionMatcher.new(self)
  yield matcher
  matcher.return_value
end

#or_nilObject



64
65
# File 'lib/option.rb', line 64

def or_nil
end