Skip to content

Instantly share code, notes, and snippets.

@yasuhito
Last active December 11, 2015 08:28
Show Gist options
  • Save yasuhito/8e3763768129f977824a to your computer and use it in GitHub Desktop.
Save yasuhito/8e3763768129f977824a to your computer and use it in GitHub Desktop.
get 'slices/:slice_id' do
rest_api { Slice.find_by!(name: params[:slice_id]) }
end
class Slice
def self.find_by!(query)
# ...
remote_klass =
Trema.trema_process('RoutingSwitch', socket_dir).controller.slice
remote_klass.find_by!(query)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment