Class: Bugloco::Exception

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

Instance Method Summary collapse

Constructor Details

#initialize(exception) ⇒ Exception

Returns a new instance of Exception.



6
7
8
9
# File 'lib/bugloco.rb', line 6

def initialize(exception)
  @exception = exception
  @proto_message = nil
end

Instance Method Details

#load_environmentObject



21
22
23
24
25
26
27
28
29
# File 'lib/bugloco.rb', line 21

def load_environment
  ENV.each do |k, v|
    pair = Bugloco::Proto::Pair.new
    pair.key = k
    pair.value = v

    @proto_message.environment_variables << pair
  end
end

#prepare_proto_messageObject



11
12
13
14
15
16
17
18
19
# File 'lib/bugloco.rb', line 11

def prepare_proto_message
  return @proto_message unless @proto_message.nil?

  @proto_message = Bugloco::Proto::Exception.new

  load_environment

  @proto_message
end