Class: ApiSpec::State

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

Class Method Summary collapse

Class Method Details

.get(key) ⇒ Object



8
9
10
# File 'lib/api_spec/state.rb', line 8

def get(key)
  state[key.to_sym] || call_helper(key)
end

.register_helper(key, &block) ⇒ Object



12
13
14
# File 'lib/api_spec/state.rb', line 12

def register_helper(key, &block)
  helpers[key.to_sym] = block
end

.resetObject



16
17
18
# File 'lib/api_spec/state.rb', line 16

def reset
  @state = {}
end

.set(key, value) ⇒ Object



4
5
6
# File 'lib/api_spec/state.rb', line 4

def set(key, value)
  state[key.to_sym] = value
end