Class: Hecks::Adapters::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/logger/logger.rb

Instance Method Summary collapse

Constructor Details

#initialize(output: []) ⇒ Logger

Returns a new instance of Logger.



5
6
7
# File 'lib/logger/logger.rb', line 5

def initialize(output: [])
  @output = output
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



9
10
11
# File 'lib/logger/logger.rb', line 9

def method_missing(name, *args, &block)
  @output << {name: name, command: args.first.to_h.to_s}.to_s
end

Instance Method Details

#respond_to?(name) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/logger/logger.rb', line 13

def respond_to?(name)
  true
end