Class: Rack::Metrics::Stack

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

Instance Method Summary collapse

Constructor Details

#initializeStack

Returns a new instance of Stack.



151
152
153
# File 'lib/rack/metrics.rb', line 151

def initialize
  @storage = []
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


172
173
174
# File 'lib/rack/metrics.rb', line 172

def empty?
  @storage.empty?
end

#firstObject



168
169
170
# File 'lib/rack/metrics.rb', line 168

def first
  @storage.first
end

#peekObject



164
165
166
# File 'lib/rack/metrics.rb', line 164

def peek
  @storage.last
end

#popObject



160
161
162
# File 'lib/rack/metrics.rb', line 160

def pop
  @storage.pop
end

#push(e) ⇒ Object Also known as: <<



155
156
157
# File 'lib/rack/metrics.rb', line 155

def push(e)
  @storage.push e
end