Class: PrySingular::Options
- Inherits:
-
Struct
- Object
- Struct
- PrySingular::Options
- Defined in:
- lib/pry-singular/option.rb
Instance Attribute Summary collapse
-
#except ⇒ Object
Returns the value of attribute except.
-
#only ⇒ Object
Returns the value of attribute only.
Instance Method Summary collapse
-
#initialize(**options) ⇒ Options
constructor
A new instance of Options.
- #remove_except_methods(methods) ⇒ Object
- #remove_methods_other_than_only(methods) ⇒ Object
Constructor Details
#initialize(**options) ⇒ Options
Returns a new instance of Options.
3 4 5 |
# File 'lib/pry-singular/option.rb', line 3 def initialize(**) super(Array([:only]), Array([:except])) end |
Instance Attribute Details
#except ⇒ Object
Returns the value of attribute except
2 3 4 |
# File 'lib/pry-singular/option.rb', line 2 def except @except end |
#only ⇒ Object
Returns the value of attribute 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 |