Class: StatModule::Detail
Instance Method Summary collapse
- #body ⇒ Object
- #body=(body) ⇒ Object
-
#initialize(body) ⇒ Detail
constructor
A new instance of Detail.
- #trace ⇒ Object
- #trace=(trace) ⇒ Object
Methods inherited from JSONable
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
#body ⇒ Object
16 17 18 |
# File 'lib/detail.rb', line 16 def body @body end |
#body=(body) ⇒ Object
11 12 13 14 |
# File 'lib/detail.rb', line 11 def body=(body) raise TypeException unless body.is_a?(String) @body = body end |
#trace ⇒ Object
29 30 31 |
# File 'lib/detail.rb', line 29 def trace @trace end |
#trace=(trace) ⇒ Object
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 |