Class: Julianus::Report
- Inherits:
-
Object
- Object
- Julianus::Report
- Defined in:
- lib/julianus/report.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Instance Method Summary collapse
-
#add_claim(c) ⇒ Object
adds new claim.
-
#claims ⇒ Object
returns all claims.
-
#has_claims? ⇒ Boolean
returns true or false according to if claim has items or false.
-
#initialize(body) ⇒ Report
constructor
new report with no claims.
- #to_s ⇒ Object
Constructor Details
#initialize(body) ⇒ Report
new report with no claims
9 10 11 12 |
# File 'lib/julianus/report.rb', line 9 def initialize body @claims = [] @body = body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
6 7 8 |
# File 'lib/julianus/report.rb', line 6 def body @body end |
Instance Method Details
#add_claim(c) ⇒ Object
adds new claim
26 27 28 29 |
# File 'lib/julianus/report.rb', line 26 def add_claim c claim = Claim.new(c[:item]) @claims << claim end |
#claims ⇒ Object
returns all claims
21 22 23 |
# File 'lib/julianus/report.rb', line 21 def claims @claims end |
#has_claims? ⇒ Boolean
returns true or false according to if claim has items or false
16 17 18 |
# File 'lib/julianus/report.rb', line 16 def has_claims? @claims.length > 0 end |
#to_s ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/julianus/report.rb', line 31 def to_s result = [] @claims.each do |claim| result << claim end result end |