Class: Julianus::Claim
- Inherits:
-
Object
- Object
- Julianus::Claim
- Defined in:
- lib/julianus/claim.rb
Instance Method Summary collapse
-
#add_item(item) ⇒ Object
add item to items list.
-
#has_items? ⇒ Boolean
returns true or false according to if claim has items or false.
-
#initialize(items) ⇒ Claim
constructor
new claim with on items.
-
#items ⇒ Object
returns list of items claim has.
- #to_s ⇒ Object
Constructor Details
Instance Method Details
#add_item(item) ⇒ Object
add item to items list
27 28 29 |
# File 'lib/julianus/claim.rb', line 27 def add_item item @items << item end |
#has_items? ⇒ Boolean
returns true or false according to if claim has items or false
17 18 19 |
# File 'lib/julianus/claim.rb', line 17 def has_items? @items.length > 0 end |
#items ⇒ Object
returns list of items claim has
22 23 24 |
# File 'lib/julianus/claim.rb', line 22 def items @items end |
#to_s ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/julianus/claim.rb', line 31 def to_s result = [] @items.each do |item| result << item end result end |