Module: Hashify

Included in:
DailyLog, LogEntry
Defined in:
worklog/hash.rb

Instance Method Summary collapse

Instance Method Details

#to_hashObject



4
5
6
7
8
9
10
11
# File 'worklog/hash.rb', line 4

def to_hash
  hash = {}
  instance_variables.each do |var|
    value = instance_variable_get(var)
    hash[var.to_s.delete('@')] = value
  end
  hash
end