Class: StatModule::Detail
Constant Summary
Constants inherited
from JSONable
JSONable::FORMATTING_BALL, JSONable::FORMATTING_CHECKMARK, JSONable::FORMATTING_STAR, JSONable::FORMATTING_WARNING
Instance Method Summary
collapse
Methods inherited from JSONable
from_json!, #to_json
Constructor Details
#initialize(body, hash = nil) ⇒ Detail
Returns a new instance of Detail.
6
7
8
9
10
11
12
13
|
# File 'lib/detail.rb', line 6
def initialize(body, hash = nil)
if hash.is_a? Hash
super(hash)
return
end
@body = body
end
|
Instance Method Details
#body ⇒ Object
20
21
22
|
# File 'lib/detail.rb', line 20
def body
@body
end
|
#body=(body) ⇒ Object
15
16
17
18
|
# File 'lib/detail.rb', line 15
def body=(body)
raise TypeException unless body.is_a?(String)
@body = body
end
|
#trace ⇒ Object
33
34
35
|
# File 'lib/detail.rb', line 33
def trace
@trace
end
|
#trace=(trace) ⇒ Object
24
25
26
27
28
29
30
31
|
# File 'lib/detail.rb', line 24
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
|