Sha256: b95ebefa896b7c5c96d4cfdb6436376a2261b2c594109366ea1f6403c009394c

Contents?: true

Size: 318 Bytes

Versions: 2

Compression:

Stored size: 318 Bytes

Contents

class Soldier

  def initialize
    @life = 10
  end

  def name
    "Tommy Boy"
  end

  def to_s
    "I'm a soldier"
  end

  def attack(target, weapon)
    weapon.attack(target)
  end

  def is_killed_by?(weapon)
    weapon.damage > 3
  end

  def survive_attack_with(weapon)
    @life - weapon.damage
  end

end


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
caricature-0.7.7 spec/fixtures/soldier.rb
caricature-0.7.6 spec/fixtures/soldier.rb