Class: Rack::WebProfiler::Collector::Definition

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/web_profiler/collector.rb

Overview

Definition

Collector definition.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#collectObject

Returns the value of attribute collect.



79
80
81
# File 'lib/rack/web_profiler/collector.rb', line 79

def collect
  @collect
end

#data_storageObject (readonly)

Returns the value of attribute data_storage.



80
81
82
# File 'lib/rack/web_profiler/collector.rb', line 80

def data_storage
  @data_storage
end

#iconObject

Returns the value of attribute icon.



79
80
81
# File 'lib/rack/web_profiler/collector.rb', line 79

def icon
  @icon
end

#identifierObject

Returns the value of attribute identifier.



79
80
81
# File 'lib/rack/web_profiler/collector.rb', line 79

def identifier
  @identifier
end

#is_enabledObject

Returns the value of attribute is_enabled.



79
80
81
# File 'lib/rack/web_profiler/collector.rb', line 79

def is_enabled
  @is_enabled
end

#klassObject

Returns the value of attribute klass.



79
80
81
# File 'lib/rack/web_profiler/collector.rb', line 79

def klass
  @klass
end

#labelObject

Returns the value of attribute label.



79
80
81
# File 'lib/rack/web_profiler/collector.rb', line 79

def label
  @label
end

#positionObject

Returns the value of attribute position.



79
80
81
# File 'lib/rack/web_profiler/collector.rb', line 79

def position
  @position
end

#templateObject

Returns the value of attribute template.



79
80
81
# File 'lib/rack/web_profiler/collector.rb', line 79

def template
  @template
end

Instance Method Details

#collect!(request, response) ⇒ Rack::WebProfiler::Collector::DSL::DataStorage

Collect the data who the Collector need.

Parameters:

Returns:

  • (Rack::WebProfiler::Collector::DSL::DataStorage)


88
89
90
# File 'lib/rack/web_profiler/collector.rb', line 88

def collect!(request, response)
  @data_storage = Docile.dsl_eval(DataStorage.new, request, response, &collect)
end

#is_enabled?Boolean

Is the collector enabled.

Returns:

  • (Boolean)


95
96
97
98
# File 'lib/rack/web_profiler/collector.rb', line 95

def is_enabled?
  return !!@is_enabled.call if @is_enabled.is_a?(Proc)
  !!@is_enabled
end