Sha256: 75158ee75019e263beb10d4d31c76161dc88e3654dcbfcddcb67423847b5c040
Contents?: true
Size: 437 Bytes
Versions: 31
Compression:
Stored size: 437 Bytes
Contents
class HelloComputed 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 end
Version data entries
31 entries across 31 versions & 2 rubygems