Class: MonkeyLens::Capture
- Inherits:
-
Object
- Object
- MonkeyLens::Capture
- Defined in:
- lib/monkey_lens/capture.rb
Constant Summary collapse
- VISIBILITIES =
%i[public protected private].freeze
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(targets:, ignore_methods: []) ⇒ Capture
constructor
A new instance of Capture.
Constructor Details
#initialize(targets:, ignore_methods: []) ⇒ Capture
Returns a new instance of Capture.
9 10 11 12 |
# File 'lib/monkey_lens/capture.rb', line 9 def initialize(targets:, ignore_methods: []) @targets = targets @ignore_methods = ignore_methods.to_set end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/monkey_lens/capture.rb', line 14 def call records = @targets.sort.to_h do |target_name| target = constantize(target_name) [target_name, capture_target(target_name, target)] end Snapshot.new( schema: Snapshot::SCHEMA, ruby: RUBY_DESCRIPTION, engine: defined?(RUBY_ENGINE) ? RUBY_ENGINE : "ruby", targets: records ) end |