Class: PrySingular::Options

Inherits:
Struct
  • Object
show all
Defined in:
lib/pry-singular/option.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**options) ⇒ Options

Returns a new instance of Options.



3
4
5
# File 'lib/pry-singular/option.rb', line 3

def initialize(**options)
  super(Array(options[:only]), Array(options[:except]))
end

Instance Attribute Details

#exceptObject

Returns the value of attribute except

Returns:

  • (Object)

    the current value of except



2
3
4
# File 'lib/pry-singular/option.rb', line 2

def except
  @except
end

#onlyObject

Returns the value of attribute only

Returns:

  • (Object)

    the current value of only



2
3
4
# File 'lib/pry-singular/option.rb', line 2

def only
  @only
end

Instance Method Details

#remove_except_methods(methods) ⇒ Object



11
12
13
# File 'lib/pry-singular/option.rb', line 11

def remove_except_methods(methods)
  methods - except
end

#remove_methods_other_than_only(methods) ⇒ Object



7
8
9
# File 'lib/pry-singular/option.rb', line 7

def remove_methods_other_than_only(methods)
  methods & only
end