Class: Datadog::Statsd::Schema::SchemaBuilder::TransformerBuilder Private

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog/statsd/schema/schema_builder.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Helper class for building transformers within the DSL

Since:

  • 0.1.0

Instance Method Summary collapse

Constructor Details

#initialize(transformers) ⇒ TransformerBuilder

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize with the transformers hash

Since:

  • 0.1.0



93
94
95
# File 'lib/datadog/statsd/schema/schema_builder.rb', line 93

def initialize(transformers)
  @transformers = transformers
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, proc = nil) {|Object| ... } ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Dynamic method to define transformers

Yields:

  • (Object)

    Value to transform

Since:

  • 0.1.0



102
103
104
# File 'lib/datadog/statsd/schema/schema_builder.rb', line 102

def method_missing(name, proc = nil, &block)
  @transformers[name.to_sym] = proc || block
end

Instance Method Details

#respond_to_missing?(_name, _include_private = false) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Always respond to any method for transformer definition

Since:

  • 0.1.0



110
111
112
# File 'lib/datadog/statsd/schema/schema_builder.rb', line 110

def respond_to_missing?(_name, _include_private = false)
  true
end