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.



147
148
149
# File 'lib/rack/metrics.rb', line 147

def initialize
  @storage = []
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
  @storage.empty?
end

#firstObject



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

def first
  @storage.first
end

#peekObject



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

def peek
  @storage.last
end

#popObject



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

def pop
  @storage.pop
end

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



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

def push(e)
  @storage.push e
end