class Transit::WriteHandlers::MapHandler

Public Instance Methods

handlers=(handlers) click to toggle source
# File lib/transit/write_handlers.rb, line 381
def handlers=(handlers)
  @handlers = handlers
end
rep(m) click to toggle source
# File lib/transit/write_handlers.rb, line 393
def rep(m)
  stringable_keys?(m) ? m : m.reduce([]) {|a, kv| a.concat(kv)}
end
string_rep(_) click to toggle source
# File lib/transit/write_handlers.rb, line 397
def string_rep(_) nil end
stringable_keys?(m) click to toggle source
# File lib/transit/write_handlers.rb, line 385
def stringable_keys?(m)
  m.keys.all? {|k| (@handlers[k.class].tag(k).length == 1) }
end
tag(m) click to toggle source
# File lib/transit/write_handlers.rb, line 389
def tag(m)
  stringable_keys?(m) ? "map" : "cmap"
end