Class: Pry::Command::Ls::Constants
- Includes:
- Interrogatable
- Defined in:
- lib/pry/commands/ls/constants.rb
Constant Summary collapse
- DEPRECATED_CONSTANTS =
%i[ Data Fixnum Bignum TimeoutError NIL FALSE TRUE ].tap do |constants| constants << :JavaPackageModuleTemplate if Helpers::Platform.jruby? end
Instance Attribute Summary
Attributes inherited from Formatter
Instance Method Summary collapse
- #correct_opts? ⇒ Boolean
-
#initialize(interrogatee, no_user_opts, opts, pry_instance) ⇒ Constants
constructor
A new instance of Constants.
- #output_self ⇒ Object
Methods inherited from Formatter
Constructor Details
#initialize(interrogatee, no_user_opts, opts, pry_instance) ⇒ Constants
Returns a new instance of Constants.
14 15 16 17 18 19 20 21 |
# File 'lib/pry/commands/ls/constants.rb', line 14 def initialize(interrogatee, no_user_opts, opts, pry_instance) super(pry_instance) @interrogatee = interrogatee @no_user_opts = no_user_opts @default_switch = opts[:constants] @verbose_switch = opts[:verbose] @dconstants = opts.dconstants? end |
Instance Method Details
#correct_opts? ⇒ Boolean
23 24 25 |
# File 'lib/pry/commands/ls/constants.rb', line 23 def correct_opts? super || (@no_user_opts && interrogating_a_module?) end |
#output_self ⇒ Object
27 28 29 30 31 |
# File 'lib/pry/commands/ls/constants.rb', line 27 def output_self mod = interrogatee_mod constants = WrappedModule.new(mod).constants(@verbose_switch) output_section('constants', grep.regexp[format(mod, constants)]) end |