Class: MSpecOption

Inherits:
Object show all
Defined in:
lib/extensions/mspec/mspec/utils/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(short, long, arg, description, block) ⇒ MSpecOption

Returns a new instance of MSpecOption.



8
9
10
11
12
13
14
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 8

def initialize(short, long, arg, description, block)
  @short       = short
  @long        = long
  @arg         = arg
  @description = description
  @block       = block
end

Instance Attribute Details

#argObject (readonly)

Returns the value of attribute arg.



6
7
8
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6

def arg
  @arg
end

#blockObject (readonly)

Returns the value of attribute block.



6
7
8
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6

def block
  @block
end

#descriptionObject (readonly)

Returns the value of attribute description.



6
7
8
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6

def description
  @description
end

#longObject (readonly)

Returns the value of attribute long.



6
7
8
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6

def long
  @long
end

#shortObject (readonly)

Returns the value of attribute short.



6
7
8
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 6

def short
  @short
end

Instance Method Details

#arg?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 16

def arg?
  @arg != nil
end

#match?(opt) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/extensions/mspec/mspec/utils/options.rb', line 20

def match?(opt)
  opt == @short or opt == @long
end