Sha256: e141b31ce9d203a99ea46865176782af48b7b714c33f6f3be3c4c76a957ae652
Contents?: true
Size: 394 Bytes
Versions: 3
Compression:
Stored size: 394 Bytes
Contents
class Contact attr_accessor :first_name, :last_name, :year_of_birth def initialize(attribute_map) @first_name = attribute_map[:first_name] @last_name = attribute_map[:last_name] @year_of_birth = attribute_map[:year_of_birth] end def name "#{last_name}, #{first_name}" end def age Time.now.year - year_of_birth.to_i rescue 0 end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
glimmer-0.1.11.SWT4.14 | samples/hellocomputed/contact.rb |
glimmer-0.1.11.470 | samples/hellocomputed/contact.rb |
glimmer-0.1.10.470 | samples/hellocomputed/contact.rb |