Class: StatModule::Detail

Inherits:
JSONable show all
Defined in:
lib/detail.rb

Instance Method Summary collapse

Methods inherited from JSONable

#to_json

Constructor Details

#initialize(body) ⇒ Detail

Returns a new instance of Detail.



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

def initialize(body)
  @body = body
  @trace = []
end

Instance Method Details

#bodyObject



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

def body
  @body
end

#body=(body) ⇒ Object

Raises:



11
12
13
14
# File 'lib/detail.rb', line 11

def body=(body)
  raise TypeException unless body.is_a?(String)
  @body = body
end

#traceObject



29
30
31
# File 'lib/detail.rb', line 29

def trace
  @trace
end

#trace=(trace) ⇒ Object

Raises:



20
21
22
23
24
25
26
27
# File 'lib/detail.rb', line 20

def trace=(trace)
  raise TypeException unless trace.is_a?(Array)
  trace.each { |item|
    raise TypeException unless item.is_a?(StatModule::Location)
    raise DuplicateElementException if @trace.include?(item)
    @trace.push(item)
  }
end