Class: CodeBuddy::App

Inherits:
Sinatra::Base
  • Object
show all
Defined in:
lib/code_buddy/app.rb

Class Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Class Attribute Details

.path_prefixObject

Returns the value of attribute path_prefix.



8
9
10
# File 'lib/code_buddy/app.rb', line 8

def path_prefix
  @path_prefix
end

.stackObject (readonly)

Returns the value of attribute stack.



7
8
9
# File 'lib/code_buddy/app.rb', line 7

def stack
  @stack
end

Class Method Details

.exception=(exception) ⇒ Object



10
11
12
# File 'lib/code_buddy/app.rb', line 10

def exception=(exception)
  @stack = Stack.new(exception)
end

.stack_string=(stack_string) ⇒ Object



14
15
16
# File 'lib/code_buddy/app.rb', line 14

def stack_string=(stack_string)
  @stack = Stack.new(stack_string)
end

Instance Method Details

#display_stack(selected_param) ⇒ Object



45
46
47
48
49
# File 'lib/code_buddy/app.rb', line 45

def display_stack(selected_param)
  @stack = self.class.stack
  @stack.selected = selected_param if @stack
  erb :index
end

#local_request?Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/code_buddy/app.rb', line 55

def local_request?
  request.ip == '127.0.0.1'
end

#path_prefixObject



51
52
53
# File 'lib/code_buddy/app.rb', line 51

def path_prefix
  self.class.path_prefix
end