Method: Train::File#to_json

Defined in:
lib/train/file.rb

#to_jsonObject



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

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