Method: Train::File#to_json

Defined in:
lib/train/file.rb

#to_jsonObject



37
38
39
40
41
42
43
# File 'lib/train/file.rb', line 37

def to_json
  res = Hash[DATA_FIELDS.map { |x| [x, method(x).call] }]
  # additional fields provided as input
  res['type'] = type
  res['follow_symlink'] = @follow_symlink
  res
end