Module: Nizicon::Members::Util

Instance Method Summary collapse

Instance Method Details

#age(current_date = Date.today) ⇒ Object



12
13
14
# File 'lib/nizicon/members.rb', line 12

def age current_date = Date.today
  current_date.year - birthday.year - (current_date.yday < birthday.yday ? 1 : 0)
end

#to_hashObject



16
17
18
19
20
21
22
# File 'lib/nizicon/members.rb', line 16

def to_hash
  public_methods(false).inject({}) do |h, m|
    h[m] = public_send(m)

    h
  end
end