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
-
#body ⇒ Object
Get body.
-
#body=(body) ⇒ Object
Set body.
-
#initialize(body, hash = nil) ⇒ Detail
constructor
Initialize new Detail object.
-
#trace ⇒ Object
Get trace.
-
#trace=(trace) ⇒ Object
Set trace.
Methods inherited from JSONable
Constructor Details
#initialize(body, hash = nil) ⇒ Detail
Initialize new Detail object
Params:
body-
String, required
hash-
Hash, can be null
12 13 14 15 16 17 18 19 20 |
# File 'lib/detail.rb', line 12 def initialize(body, hash = nil) if hash.is_a? Hash super(hash) return end raise TypeException unless body.is_a?(String) @body = body end |
Instance Method Details
#body ⇒ Object
Get body
34 35 36 |
# File 'lib/detail.rb', line 34 def body @body end |
#body=(body) ⇒ Object
Set body
Params:
body-
String
27 28 29 30 |
# File 'lib/detail.rb', line 27 def body=(body) raise TypeException unless body.is_a?(String) @body = body end |
#trace ⇒ Object
Get trace
54 55 56 |
# File 'lib/detail.rb', line 54 def trace @trace end |
#trace=(trace) ⇒ Object
Set trace
Params:
trace-
array of StatModule::Location objects
43 44 45 46 47 48 49 50 |
# File 'lib/detail.rb', line 43 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 |