Sinatra is a DSL for quickly creating web applications in Ruby with minimal effort:
# myapp.rb require 'sinatra' get '/' do 'Hello world!' end
Install the gem and run with:
gem install sinatra ruby -rubygems myapp.rb
View at: localhost:4567
It is recommended to also run gem install thin, which Sinatra will pick up if available.
In Sinatra, a route is an HTTP method paired with a URL-matching pattern. Each route is associated with a block:
get '/' do .. show something .. end post '/' do .. create something .. end put '/' do .. replace something .. end patch '/' do .. modify something .. end delete '/' do .. annihilate something .. end options '/' do .. appease something .. end
Routes are matched in the order they are defined. The first route that matches the request is invoked.
Route patterns may include named parameters, accessible via the params hash:
get '/hello/:name' do # matches "GET /hello/foo" and "GET /hello/bar" # params[:name] is 'foo' or 'bar' "Hello #{params[:name]}!" end
You can also access named parameters via block parameters:
get '/hello/:name' do |n| "Hello #{n}!" end
Route patterns may also include splat (or wildcard) parameters, accessible via the params[:splat] array:
get '/say/*/to/*' do # matches /say/hello/to/world params[:splat] # => ["hello", "world"] end get '/download/*.*' do # matches /download/path/to/file.xml params[:splat] # => ["path/to/file", "xml"] end
Or with block parameters:
get '/download/*.*' do |path, ext| [path, ext] # => ["path/to/file", "xml"] end
Route matching with Regular Expressions:
get %r{/hello/([\w]+)} do "Hello, #{params[:captures].first}!" end
Or with a block parameter:
get %r{/hello/([\w]+)} do |c| "Hello, #{c}!" end
Route patterns may have optional parameters:
get '/posts.?:format?' do # matches "GET /posts" and any extension "GET /posts.json", "GET /posts.xml" etc. end
By the way, unless you disable the path traversal attack protection (see below), the request path might be modified before matching against your routes.
Routes may include a variety of matching conditions, such as the user agent:
get '/foo', :agent => /Songbird (\d\.\d)[\d\/]*?/ do "You're using Songbird version #{params[:agent][0]}" end get '/foo' do # Matches non-songbird browsers end
Other available conditions are host_name and provides:
get '/', :host_name => /^admin\./ do "Admin Area, Access denied!" end get '/', :provides => 'html' do haml :index end get '/', :provides => ['rss', 'atom', 'xml'] do builder :feed end
You can easily define your own conditions:
set(:probability) { |value| condition { rand <= value } } get '/win_a_car', :probability => 0.1 do "You won!" end get '/win_a_car' do "Sorry, you lost." end
For a condition that takes multiple values use a splat:
set(:auth) do |*roles| # <- notice the splat here condition do unless logged_in? && roles.any? {|role| current_user.in_role? role } redirect "/login/", 303 end end end get "/my/account/", :auth => [:user, :admin] do "Your Account Details" end get "/only/admin/", :auth => :admin do "Only admins are allowed here!" end
The return value of a route block determines at least the response body passed on to the HTTP client, or at least the next middleware in the Rack stack. Most commonly, this is a string, as in the above examples. But other values are also accepted.
You can return any object that would either be a valid Rack response, Rack body object or HTTP status code:
An Array with three elements: [status (Fixnum), headers (Hash), response body (responds to #)]
An Array with two elements: [status (Fixnum), response body (responds to #)]
An object that responds to # and passes nothing but strings to the given block
A Fixnum representing the status code
That way we can, for instance, easily implement a streaming example:
class Stream def each 100.times { |i| yield "#{i}\n" } end end get('/') { Stream.new }
You can also use the stream helper method (described below) to reduce boiler plate and embed the streaming logic in the route.
As shown above, Sinatra ships with built-in support for using String patterns and regular expressions as route matches. However, it does not stop there. You can easily define your own matchers:
class AllButPattern Match = Struct.new(:captures) def initialize(except) @except = except @captures = Match.new([]) end def match(str) @captures unless @except === str end end def all_but(pattern) AllButPattern.new(pattern) end get all_but("/index") do # ... end
Note that the above example might be over-engineered, as it can also be expressed as:
get // do pass if request.path_info == "/index" # ... end
Or, using negative look ahead:
get %r{^(?!/index$)} do # ... end
Static files are served from the ./public directory. You can specify a different location by setting the :public_folder option:
set :public_folder, File.dirname(__FILE__) + '/static'
Note that the public directory name is not included in the URL. A file ./public/css/style.css is made available as example.com/css/style.css.
Use the :static_cache_control setting (see below) to add Cache-Control header info.
Each template language is exposed as via its own rendering method. These methods simply return a string:
get '/' do erb :index end
This renders views/index.erb.
Instead of a template name, you can also just pass in the template content directly:
get '/' do code = "<%= Time.now >" erb code end
Templates take a second argument, the options hash:
get '/' do erb :index, :layout => :post end
This will render views/index.erb embedded in the views/post.erb (default is views/layout.erb, if it exists).
Any options not understood by Sinatra will be passed on to the template engine:
get '/' do haml :index, :format => :html5 end
You can also set options per template language in general:
set :haml, :format => :html5 get '/' do haml :index end
Options passed to the render method override options set via set.
Available Options:
List of locals passed to the document. Handy with partials. Example: erb "<%= foo %>", :locals => {:foo => "bar"}
String encoding to use if uncertain. Defaults to settings.default_encoding.
Views folder to load templates from. Defaults to settings.views.
Whether to use a layout (true or false), if it’s a Symbol, specifies what template to use. Example: erb :index, :layout => !request.xhr?
Content-Type the template produces, default depends on template language.
Scope to render template under. Defaults to the application instance. If you change this, instance variables and helper methods will not be available.
Template engine to use for rendering the layout. Useful for languages that do not support layouts otherwise. Defaults to the engine used for the template. Example: set :rdoc, :layout_engine => :erb
Templates are assumed to be located directly under the ./views directory. To use a different views directory:
set :views, settings.root + '/templates'
One important thing to remember is that you always have to reference templates with symbols, even if they’re in a subdirectory (in this case, use :'subdir/template'). You must use a symbol because otherwise rendering methods will render any strings passed to them directly.
Some languages have multiple implementations. To specify what implementation to use (and to be thread-safe), you should simply require it first:
require 'rdiscount' # or require 'bluecloth' get('/') { markdown :index }
| Dependency | |
| File Extensions | .haml |
| Example | haml :index, :format => :html5 |
| Dependency | erubis or erb (included in Ruby) |
| File Extensions | .erb, .rhtml or .erubis (Erubis only) |
| Example | erb :index |
| Dependency | |
| File Extensions | .builder |
| Example | builder { |xml| xml.em "hi" } |
It also takes a block for inline templates (see example).
| Dependency | |
| File Extensions | .nokogiri |
| Example | nokogiri { |xml| xml.em "hi" } |
It also takes a block for inline templates (see example).
| Dependency | |
| File Extensions | .sass |
| Example | sass :stylesheet, :style => :expanded |
| Dependency | |
| File Extensions | .scss |
| Example | scss :stylesheet, :style => :expanded |
| Dependency | |
| File Extensions | .less |
| Example | less :stylesheet |
| Dependency | |
| File Extensions | .liquid |
| Example | liquid :index, :locals => { :key => 'value' } |
Since you cannot call Ruby methods (except for yield) from a Liquid template, you almost always want to pass locals to it.
| Dependency | |
| File Extensions | .markdown, .mkd and .md |
| Example | markdown :index, :layout_engine => :erb |
It is not possible to call methods from markdown, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine:
erb :overview, :locals => { :text => markdown(:introduction) }
Note that you may also call the markdown method from within other templates:
%h1 Hello From Haml! %p= markdown(:greetings)
Since you cannot call Ruby from Markdown, you cannot use layouts written in Markdown. However, it is possible to use another rendering engine for the template than for the layout by passing the :layout_engine option.
| Dependency | |
| File Extensions | .textile |
| Example | textile :index, :layout_engine => :erb |
It is not possible to call methods from textile, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine:
erb :overview, :locals => { :text => textile(:introduction) }
Note that you may also call the textile method from within other templates:
%h1 Hello From Haml! %p= textile(:greetings)
Since you cannot call Ruby from Textile, you cannot use layouts written in Textile. However, it is possible to use another rendering engine for the template than for the layout by passing the :layout_engine option.
| Dependency | |
| File Extensions | .rdoc |
| Example | rdoc :README, :layout_engine => :erb |
It is not possible to call methods from rdoc, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine:
erb :overview, :locals => { :text => rdoc(:introduction) }
Note that you may also call the rdoc method from within other templates:
%h1 Hello From Haml! %p= rdoc(:greetings)
Since you cannot call Ruby from RDoc, you cannot use layouts written in RDoc. However, it is possible to use another rendering engine for the template than for the layout by passing the :layout_engine option.
| Dependency | |
| File Extensions | .radius |
| Example | radius :index, :locals => { :key => 'value' } |
Since you cannot call Ruby methods directly from a Radius template, you almost always want to pass locals to it.
| Dependency | |
| File Extensions | .mab |
| Example | markaby { h1 "Welcome!" } |
It also takes a block for inline templates (see example).
| Dependency | |
| File Extensions | .slim |
| Example | slim :index |
| Dependency | |
| File Extensions | .creole |
| Example | creole :wiki, :layout_engine => :erb |
It is not possible to call methods from creole, nor to pass locals to it. You therefore will usually use it in combination with another rendering engine:
erb :overview, :locals => { :text => creole(:introduction) }
Note that you may also call the creole method from within other templates:
%h1 Hello From Haml! %p= creole(:greetings)
Since you cannot call Ruby from Creole, you cannot use layouts written in Creole. However, it is possible to use another rendering engine for the template than for the layout by passing the :layout_engine option.
| Dependency | |
| File Extensions | .coffee |
| Example | coffee :index |
get '/' do haml '%div.title Hello World' end
Renders the embedded template string.
Templates are evaluated within the same context as route handlers. Instance variables set in route handlers are directly accessible by templates:
get '/:id' do @foo = Foo.find(params[:id]) haml '%h1= @foo.name' end
Or, specify an explicit Hash of local variables:
get '/:id' do foo = Foo.find(params[:id]) haml '%h1= bar.name', :locals => { :bar => foo } end
This is typically used when rendering templates as partials from within other templates.
Templates may be defined at the end of the source file:
require 'sinatra' get '/' do haml :index end __END__ @@ layout %html = yield @@ index %div.title Hello world!!!!!
NOTE: Inline templates defined in the source file that requires sinatra are automatically loaded. Call enable :inline_templates explicitly if you have inline templates in other source files.
Templates may also be defined using the top-level template method:
template :layout do "%html\n =yield\n" end template :index do '%div.title Hello World!' end get '/' do haml :index end
If a template named “layout” exists, it will be used each time a template is rendered. You can individually disable layouts by passing :layout => false or disable them by default via set :haml, :layout => false:
get '/' do haml :index, :layout => !request.xhr? end
To associate a file extension with a template engine, use Tilt.register. For instance, if you like to use the file extension tt for Textile templates, you can do the following:
Tilt.register :tt, Tilt[:textile]
First, register your engine with Tilt, then create a rendering method:
Tilt.register :myat, MyAwesomeTemplateEngine helpers do def myat(*args) render(:myat, *args) end end get '/' do myat :index end
Renders ./views/index.myat. See github.com/rtomayko/tilt to learn more about Tilt.
Before filters are evaluated before each request within the same context as the routes will be and can modify the request and response. Instance variables set in filters are accessible by routes and templates:
before do @note = 'Hi!' request.path_info = '/foo/bar/baz' end get '/foo/*' do @note #=> 'Hi!' params[:splat] #=> 'bar/baz' end
After filters are evaluated after each request within the same context and can also modify the request and response. Instance variables set in before filters and routes are accessible by after filters:
after do puts response.status end
Note: Unless you use the body method rather than just returning a String from the routes, the body will not yet be available in the after filter, since it is generated later on.
Filters optionally take a pattern, causing them to be evaluated only if the request path matches that pattern:
before '/protected/*' do authenticate! end after '/create/:slug' do |slug| session[:last_slug] = slug end
Like routes, filters also take conditions:
before :agent => /Songbird/ do # ... end after '/blog/*', :host_name => 'example.com' do # ... end
Use the top-level helpers method to define helper methods for use in route handlers and templates:
helpers do def bar(name) "#{name}bar" end end get '/:name' do bar(params[:name]) end
A session is used to keep state during requests. If activated, you have one session hash per user session:
enable :sessions get '/' do "value = " << session[:value].inspect end get '/:value' do session[:value] = params[:value] end
Note that enable :sessions actually stores all data in a cookie. This might not always be what you want (storing lots of data will increase your traffic, for instance). You can use any Rack session middleware: in order to do so, do not call enable :sessions, but instead pull in your middleware of choice as you would any other middleware:
use Rack::Session::Pool, :expire_after => 2592000 get '/' do "value = " << session[:value].inspect end get '/:value' do session[:value] = params[:value] end
To improve security, the session data in the cookie is signed with a session secret. A random secret is generate for you by Sinatra. However, since this secret will change with every start of your application, you might want to set the secret yourself, so all your application instances share it:
set :session_secret, 'super secret'
If you want to configure it further, you may also store a hash with options in the sessions setting:
set :sessions, :domain => 'foo.com'
To immediately stop a request within a filter or route use:
halt
You can also specify the status when halting:
halt 410
Or the body:
halt 'this will be the body'
Or both:
halt 401, 'go away!'
With headers:
halt 402, {'Content-Type' => 'text/plain'}, 'revenge'
It is of course possible to combine a template with halt:
halt erb(:error)
A route can punt processing to the next matching route using pass:
get '/guess/:who' do pass unless params[:who] == 'Frank' 'You got me!' end get '/guess/*' do 'You missed!' end
The route block is immediately exited and control continues with the next matching route. If no matching route is found, a 404 is returned.
Sometimes pass is not what you want, instead you would like to get the result of calling another route. Simply use call to achieve this:
get '/foo' do status, headers, body = call env.merge("PATH_INFO" => '/bar') [status, headers, body.map(&:upcase)] end get '/bar' do "bar" end
Note that in the example above, you would ease testing and increase performance by simply moving "bar" into a helper used by both /foo and /bar.
If you want the request to be sent to the same application instance rather than a duplicate, use call! instead of call.
Check out the Rack specification if you want to learn more about call.
It is possible and recommended to set the status code and response body with the return value of the route block. However, in some scenarios you might want to set the body at an arbitrary point in the execution flow. You can do so with the body helper method. If you do so, you can use that method from there on to access the body:
get '/foo' do body "bar" end after do puts body end
It is also possible to pass a block to body, which will be executed by the Rack handler (this can be used to implement streaming, see “Return Values”).
Similar to the body, you can also set the status code and headers:
get '/foo' do status 418 headers \ "Allow" => "BREW, POST, GET, PROPFIND, WHEN", "Refresh" => "Refresh: 20; http://www.ietf.org/rfc/rfc2324.txt" body "I'm a tea pot!" end
Like body, headers and status with no arguments can be used to access their current values.
Sometimes you want to start sending out data while still generating parts of the response body. In extreme examples, you want to keep sending data until the client closes the connection. You can use the stream helper to avoid creating your own wrapper:
get '/' do stream do |out| out << "It's gonna be legen -\n" sleep 0.5 out << " (wait for it) \n" sleep 1 out << "- dary!\n" end end
This allows you to implement streaming APIs, Server Sent Events and can be used as basis for WebSockets. It can also be used to increase throughput if some but not all content depends on a slow resource.
Note that the streaming behavior, especially the number of concurrent request, highly depends on the web server used to serve the application. Some servers, like WEBRick, might not even support streaming at all. If the server does not support streaming, the body will be sent all at once after the block passed to stream finished executing.
If the optional parameter is set to keep_open, it will not call close on the stream object, allowing you to close it at any later point in the execution flow. This only works on evented servers, like Thin and Rainbows. Other servers will still close the stream:
set :server, :thin connections = [] get '/' do # keep stream open stream(:keep_open) { |out| connections << out } end post '/' do # write to all open streams connections.each { |out| out << params[:message] << "\n" } "message sent" end
In the request scope, the logger helper exposes a Logger instance:
get '/' do logger.info "loading data" # ... end
This logger will automatically take your Rack handler’s logging settings into account. If logging is disabled, this method will return a dummy object, so you do not have to worry in your routes and filters about it.
Note that logging is only enabled for Sinatra::Application by default, so if you inherit from Sinatra::Base, you probably want to enable it yourself:
class MyApp < Sinatra::Base configure(:production, :development) do enable :logging end end
When using send_file or static files you may have mime types Sinatra doesn’t understand. Use mime_type to register them by file extension:
configure do mime_type :foo, 'text/foo' end
You can also use it with the content_type helper:
get '/' do content_type :foo "foo foo foo" end
For generating URLs you should use the url helper method, for instance, in Haml:
%a{:href => url('/foo')} foo
It takes reverse proxies and Rack routers into account, if present.
This method is also aliased to to (see below for an example).
You can trigger a browser redirect with the redirect helper method:
get '/foo' do redirect to('/bar') end
Any additional parameters are handled like arguments passed to halt:
redirect to('/bar'), 303 redirect 'http://google.com', 'wrong place, buddy'
You can also easily redirect back to the page the user came from with redirect back:
get '/foo' do "<a href='/bar'>do something</a>" end get '/bar' do do_something redirect back end
To pass arguments with a redirect, either add them to the query:
redirect to('/bar?sum=42')
Or use a session:
enable :sessions get '/foo' do session[:secret] = 'foo' redirect to('/bar') end get '/bar' do session[:secret] end
Setting your headers correctly is the foundation for proper HTTP caching.
You can easily set the Cache-Control header with like this:
get '/' do cache_control :public "cache it!" end
Pro tip: Set up caching in a before filter:
before do cache_control :public, :must_revalidate, :max_age => 60 end
If you are using the expires helper to set the corresponding header, Cache-Control will be set automatically for you:
before do expires 500, :public, :must_revalidate end
To properly use caches, you should consider using etag or last_modified. It is recommended to call those helpers before doing heavy lifting, as they will immediately flush a response if the client already has the current version in its cache:
get '/article/:id' do @article = Article.find params[:id] last_modified @article.updated_at etag @article.sha1 erb :article end
It is also possible to use a weak ETag:
etag @article.sha1, :weak
These helpers will not do any caching for you, but rather feed the necessary information to your cache. If you are looking for a quick reverse-proxy caching solution, try rack-cache:
require "rack/cache" require "sinatra" use Rack::Cache get '/' do cache_control :public, :max_age => 36000 sleep 5 "hello" end
Use the :static_cache_control setting (see below) to add Cache-Control header info to static files.
According to RFC 2616 your application should behave differently if the If-Match or If-None-Match header is set to * depending on whether the resource requested is already in existence. Sinatra assumes resources for safe (like get) and idempotent (like put) requests are already in existence, whereas other resources (for instance for post requests), are treated as new resources. You can change this behavior by passing in a :new_resource option:
get '/create' do etag '', :new_resource => true Article.create erb :new_article end
If you still want to use a weak ETag, pass in a :kind option:
etag '', :new_resource => true, :kind => :weak
For sending files, you can use the send_file helper method:
get '/' do send_file 'foo.png' end
It also takes a couple of options:
send_file 'foo.png', :type => :jpg
The options are:
file name, in response, defaults to the real file name.
value for Last-Modified header, defaults to the file’s mtime.
content type to use, guessed from the file extension if missing.
used for Content-Disposition, possible values: nil (default), :attachment and :inline
Content-Length header, defaults to file size.
If supported by the Rack handler, other means than streaming from the Ruby process will be used. If you use this helper method, Sinatra will automatically handle range requests.
The incoming request object can be accessed from request level (filter, routes, error handlers) through the request method:
# app running on http://example.com/example get '/foo' do t = %w[text/css text/html application/javascript] request.accept # ['text/html', '*/*'] request.accept? 'text/xml' # true request.preferred_type(t) # 'text/html' request.body # request body sent by the client (see below) request.scheme # "http" request.script_name # "/example" request.path_info # "/foo" request.port # 80 request.request_method # "GET" request.query_string # "" request.content_length # length of request.body request.media_type # media type of request.body request.host # "example.com" request.get? # true (similar methods for other verbs) request.form_data? # false request["SOME_HEADER"] # value of SOME_HEADER header request.referrer # the referrer of the client or '/' request.user_agent # user agent (used by :agent condition) request.cookies # hash of browser cookies request.xhr? # is this an ajax request? request.url # "http://example.com/example/foo" request.path # "/example/foo" request.ip # client IP address request.secure? # false (would be true over ssl) request.forwarded? # true (if running behind a reverse proxy) request.env # raw env hash handed in by Rack end
Some options, like script_name or path_info, can also be written:
before { request.path_info = "/" } get "/" do "all requests end up here" end
The request.body is an IO or StringIO object:
post "/api" do request.body.rewind # in case someone already read it data = JSON.parse request.body.read "Hello #{data['name']}!" end
You can use the attachment helper to tell the browser the response should be stored on disk rather than displayed in the browser:
get '/' do attachment "store it!" end
You can also pass it a file name:
get '/' do attachment "info.txt" "store it!" end
Sinatra offers a time_for helper method, which, from the given value generates a Time object. It is also able to convert DateTime, Date and similar classes:
get '/' do pass if Time.now > time_for('Dec 23, 2012') "still time" end
This method is used internally by expires, last_modified and akin. You can therefore easily extend the behavior of those methods by overriding time_for in your application:
helpers do def time_for(value) case value when :yesterday then Time.now - 24*60*60 when :tomorrow then Time.now + 24*60*60 else super end end end get '/' do last_modified :yesterday expires :tomorrow "hello" end
The find_template helper is used to find template files for rendering:
find_template settings.views, 'foo', Tilt[:haml] do |file| puts "could be #{file}" end
This is not really useful.  For instance, if you want to be able to use more than one view directory:
set :views, ['views', 'templates'] helpers do def find_template(views, name, engine, &block) Array(views).each { |v| super(v, name, engine, &block) } end end
Another example would be using different directories for different engines:
set :views, :sass => 'views/sass', :haml => 'templates', :default => 'views' helpers do def find_template(views, name, engine, &block) _, folder = views.detect { |k,v| engine == Tilt[k] } folder ||= views[:default] super(folder, name, engine, &block) end end
You can also easily wrap this up in an extension and share with others!
Note that find_template does not check if the file really exists but rather calls the given block for all possible paths. This is not a performance issue, since render will use break as soon as a file is found. Also, template locations (and content) will be cached if you are not running in development mode. You should keep that in mind if you write a really crazy method.
Run once, at startup, in any environment:
configure do # setting one option set :option, 'value' # setting multiple options set :a => 1, :b => 2 # same as `set :option, true` enable :option # same as `set :option, false` disable :option # you can also have dynamic settings with blocks set(:css_dir) { File.join(views, 'css') } end
Run only when the environment (RACK_ENV environment variable) is set to :production:
configure :production do ... end
Run when the environment is set to either :production or :test:
configure :production, :test do ... end
You can access those options via settings:
configure do set :foo, 'bar' end get '/' do settings.foo? # => true settings.foo # => 'bar' ... end
Sinatra is using Rack::Protection to defend you application against common, opportunistic attacks. You can easily disable this behavior (which should result in performance gains):
disable :protection
To skip a single defense layer, set protection to an options hash:
set :protection, :except => :path_traversal
You can also hand in an array in order to disable a list of protections:
set :protections, :except => [:path_traversal, :session_hijacking]
If disabled, Sinatra will allow relative redirects, however, Sinatra will no longer conform with RFC 2616 (HTTP 1.1), which only allows absolute redirects.
Enable if your app is running behind a reverse proxy that has not been set up properly. Note that the url helper will still produce absolute URLs, unless you pass in false as second parameter.
Disabled per default.
mime types the content_type helper will automatically add the charset info to.
You should add to it rather than overriding this option:
settings.add_charsets << "application/foobar"
main application file, used to detect project root, views and public folder and inline templates.
IP address to bind to (default: <IP_ADDRESS>). Only used for built-in server.
encoding to assume if unknown (defaults to "utf-8").
display errors in the log.
current environment, defaults to ENV['RACK_ENV'], or "development" if not available.
use the logger.
Places a lock around every request, only running processing on request per Ruby process concurrently.
Enabled if your app is not thread-safe. Disabled per default.
use _method magic to allow put/delete forms in browsers that don’t support it.
Port to listen on. Only used for built-in server.
Whether or not to insert request.script_name into redirects if no absolute path is given. That way redirect '/foo' would behave like redirect to('/foo'). Disabled per default.
Whether or not to enable web attack protections. See protection section above.
folder public files are served from
whether or not to reload templates between requests. Enabled in development mode.
project root folder.
raise exceptions (will stop application).
if enabled, Sinatra will handle starting the web server, do not enable if using rackup or other means.
is the built-in server running now? do not change this setting!
server or list of servers to use for built-in server. defaults to [‘thin’, ‘mongrel’, ‘webrick’], order indicates priority.
enable cookie based sessions.
show a stack trace in the browser.
Whether Sinatra should handle serving static files. Disable when using a Server able to do this on its own. Disabling will boost performance. Enabled per default in classic style, disabled for modular apps.
When Sinatra is serving static files, set this to add Cache-Control headers to the responses. Uses the cache_control helper. Disabled by default. Use an explicit array when setting multiple values: set :static_cache_control, [:public, :max_age => 300]
If set to true, will tell Thin to use EventMachine.defer for processing the request.
views folder.
Error handlers run within the same context as routes and before filters, which means you get all the goodies it has to offer, like haml, erb, halt, etc.
When a Sinatra::NotFound exception is raised, or the response’s status code is 404, the not_found handler is invoked:
not_found do 'This is nowhere to be found.' end
The error handler is invoked any time an exception is raised from a route block or a filter. The exception object can be obtained from the sinatra.error Rack variable:
error do 'Sorry there was a nasty error - ' + env['sinatra.error'].name end
Custom errors:
error MyCustomError do 'So what happened was...' + env['sinatra.error'].message end
Then, if this happens:
get '/' do raise MyCustomError, 'something bad' end
You get this:
So what happened was... something bad
Alternatively, you can install an error handler for a status code:
error 403 do 'Access forbidden' end get '/secret' do 403 end
Or a range:
error 400..510 do 'Boom' end
Sinatra installs special not_found and error handlers when running under the development environment.
Sinatra rides on Rack, a minimal standard interface for Ruby web frameworks. One of Rack’s most interesting capabilities for application developers is support for “middleware” — components that sit between the server and your application monitoring and/or manipulating the HTTP request/response to provide various types of common functionality.
Sinatra makes building Rack middleware pipelines a cinch via a top-level use method:
require 'sinatra' require 'my_custom_middleware' use Rack::Lint use MyCustomMiddleware get '/hello' do 'Hello World' end
The semantics of use are identical to those defined for the Rack::Builder DSL (most frequently used from rackup files). For example, the use method accepts multiple/variable args as well as blocks:
use Rack::Auth::Basic do |username, password| username == 'admin' && password == 'secret' end
Rack is distributed with a variety of standard middleware for logging, debugging, URL routing, authentication, and session handling. Sinatra uses many of these components automatically based on configuration so you typically don’t have to use them explicitly.
You can find useful middleware in rack, rack-contrib, with CodeRack or in the Rack wiki.
Sinatra tests can be written using any Rack-based testing library or framework. Rack::Test is recommended:
require 'my_sinatra_app' require 'test/unit' require 'rack/test' class MyAppTest < Test::Unit::TestCase include Rack::Test::Methods def app Sinatra::Application end def test_my_default get '/' assert_equal 'Hello World!', last_response.body end def test_with_params get '/meet', :name => 'Frank' assert_equal 'Hello Frank!', last_response.body end def test_with_rack_env get '/', {}, 'HTTP_USER_AGENT' => 'Songbird' assert_equal "You're using Songbird!", last_response.body end end
Defining your app at the top-level works well for micro-apps but has considerable drawbacks when building reusable components such as Rack middleware, Rails metal, simple libraries with a server component, or even Sinatra extensions. The top-level DSL pollutes the Object namespace and assumes a micro-app style configuration (e.g., a single application file, ./public and ./views directories, logging, exception detail page, etc.). That’s where Sinatra::Base comes into play:
require 'sinatra/base' class MyApp < Sinatra::Base set :sessions, true set :foo, 'bar' get '/' do 'Hello world!' end end
The methods available to Sinatra::Base subclasses are exactly as those available via the top-level DSL. Most top-level apps can be converted to Sinatra::Base components with two modifications:
Your file should require sinatra/base instead of sinatra; otherwise, all of Sinatra’s DSL methods are imported into the main namespace.
Put your app’s routes, error handlers, filters, and options in a subclass of Sinatra::Base.
Sinatra::Base is a blank slate. Most options are disabled by default, including the built-in server. See Options and Configuration for details on available options and their behavior.
Contrary to common belief, there is nothing wrong with classic style. If it suits your application, you do not have to switch to a modular application.
There are only two downsides compared with modular style:
You may only have one Sinatra application per Ruby process. If you plan to use more, switch to modular style.
Classic style pollutes Object with delegator methods. If you plan to ship your application in a library/gem, switch to modular style.
There is no reason you cannot mix modular and classic style.
If switching from one style to the other, you should be aware of slightly different default settings:
Setting Classic Modular app_file file loading sinatra file subclassing Sinatra::Base run $0 == app_file false logging true false method_override true false inline_templates true false static true false
There are two common options for starting a modular app, actively starting with run!:
# my_app.rb require 'sinatra/base' class MyApp < Sinatra::Base # ... app code here ... # start the server if ruby file executed directly run! if app_file == $0 end
Start with:
ruby my_app.rb
Or with a config.ru, which allows using any Rack handler:
# config.ru require './my_app' run MyApp
Run:
rackup -p 4567
Write your app file:
# app.rb require 'sinatra' get '/' do 'Hello world!' end
And a corresponding config.ru:
require './app' run Sinatra::Application
Good signs you probably want to use a config.ru:
You want to deploy with a different Rack handler (Passenger, Unicorn, Heroku, …).
You want to use more than one subclass of Sinatra::Base.
You want to use Sinatra only for middleware, but not as endpoint.
There is no need to switch to a config.ru only because you switched to modular style, and you don’t have to use modular style for running with a config.ru.
Not only is Sinatra able to use other Rack middleware, any Sinatra application can in turn be added in front of any Rack endpoint as middleware itself. This endpoint could be another Sinatra application, or any other Rack-based application (Rails/Ramaze/Camping/...):
require 'sinatra/base' class LoginScreen < Sinatra::Base enable :sessions get('/login') { haml :login } post('/login') do if params[:name] == 'admin' && params[:password] == 'admin' session['user_name'] = params[:name] else redirect '/login' end end end class MyApp < Sinatra::Base # middleware will run before filters use LoginScreen before do unless session['user_name'] halt "Access denied, please <a href='/login'>login</a>." end end get('/') { "Hello #{session['user_name']}." } end
Sometimes you want to create new applications at runtime without having to assign them to a constant, you can do this with Sinatra.new:
require 'sinatra/base' my_app = Sinatra.new { get('/') { "hi" } } my_app.run!
It takes the application to inherit from as optional argument:
# config.ru require 'sinatra/base' controller = Sinatra.new do enable :logging helpers MyHelpers end map('/a') do run Sinatra.new(controller) { get('/') { 'a' } } end map('/b') do run Sinatra.new(controller) { get('/') { 'b' } } end
This is especially useful for testing Sinatra extensions or using Sinatra in your own library.
This also makes using Sinatra as middleware extremely easy:
require 'sinatra/base' use Sinatra do get('/') { ... } end run RailsProject::Application
The scope you are currently in determines what methods and variables are available.
Every Sinatra application corresponds to a subclass of Sinatra::Base. If you are using the top-level DSL (require 'sinatra'), then this class is Sinatra::Application, otherwise it is the subclass you created explicitly. At class level you have methods like get or before, but you cannot access the request object or the session, as there only is a single application class for all requests.
Options created via set are methods at class level:
class MyApp < Sinatra::Base # Hey, I'm in the application scope! set :foo, 42 foo # => 42 get '/foo' do # Hey, I'm no longer in the application scope! end end
You have the application scope binding inside:
Your application class body
Methods defined by extensions
The block passed to helpers
Procs/blocks used as value for set
The block passed to Sinatra.new
You can reach the scope object (the class) like this:
Via the object passed to configure blocks (configure { |c| ... })
settings from within request scope
For every incoming request, a new instance of your application class is created and all handler blocks run in that scope. From within this scope you can access the request and session object or call rendering methods like erb or haml. You can access the application scope from within the request scope via the settings helper:
class MyApp < Sinatra::Base # Hey, I'm in the application scope! get '/define_route/:name' do # Request scope for '/define_route/:name' @value = 42 settings.get("/#{params[:name]}") do # Request scope for "/#{params[:name]}" @value # => nil (not the same request) end "Route defined!" end end
You have the request scope binding inside:
get/head/post/put/delete/options blocks
before/after filters
helper methods
templates/views
The delegation scope just forwards methods to the class scope. However, it does not behave 100% like the class scope, as you do not have the class binding. Only methods explicitly marked for delegation are available and you do not share variables/state with the class scope (read: you have a different self). You can explicitly add method delegations by calling Sinatra::Delegator.delegate :method_name.
You have the delegate scope binding inside:
The top level binding, if you did require "sinatra"
An object extended with the Sinatra::Delegator mixin
Have a look at the code for yourself: here’s the Sinatra::Delegator mixin being included into the main namespace.
Sinatra applications can be run directly:
ruby myapp.rb [-h] [-x] [-e ENVIRONMENT] [-p PORT] [-o HOST] [-s HANDLER]
Options are:
-h # help -p # set the port (default is 4567) -o # set the host (default is <IP_ADDRESS>) -e # set the environment (default is development) -s # specify rack server/handler (default is thin) -x # turn on the mutex lock (default is off)
The following Ruby versions are officially supported:
1.8.7 is fully supported, however, if nothing is keeping you from it, we recommend upgrading to 1.9.2 or switching to JRuby or Rubinius. Support for 1.8.7 will not be dropped before Sinatra 2.0 and Ruby 2.0 except maybe for the unlikely event of 1.8.8 being released. Even then, we might continue supporting it. Ruby 1.8.6 is no longer supported. If you want to run with 1.8.6, downgrade to Sinatra 1.2, which will receive bug fixes until Sinatra 1.4.0 is released.
1.9.2 is fully supported and recommended. Note that Radius and Markaby are currently not 1.9 compatible. Do not use 1.9.2p0, it is known to cause segmentation faults when running Sinatra. Support will continue at least until the release of Ruby 1.9.4/2.0 and support for the latest 1.9 release will continue as long as it is still supported by the Ruby core team.
While we test against 1.9.3 we do not know of anyone using it in production yet, and as with 1.9.2, you might want to be careful with patch level zero.
Rubinius is officially supported (Rubinius >= 1.2.4), everything, including all template languages, works.
JRuby is officially supported (JRuby >= 1.6.3). No issues with third party template libraries are known, however, if you choose to use JRuby, please look into JRuby rack handlers, as the Thin web server is not fully supported on JRuby. JRuby’s support for C extensions is still experimental, which only affects RDiscount and Redcarpet at the moment.
We also keep an eye on upcoming Ruby versions.
The following Ruby implementations are not officially supported but still are known to run Sinatra:
Older versions of JRuby and Rubinius
Ruby Enterprise Edition
MacRuby, Maglev, IronRuby
Ruby 1.9.0 and 1.9.1 (but we do recommend against using those)
Not being officially supported means if things only break there and not on a supported platform, we assume it’s not our issue but theirs.
We also run our CI against ruby-head (the upcoming 1.9.4), but we can’t guarantee anything, since it is constantly moving. Expect 1.9.4p0 to be supported.
Sinatra should work on any operating system supported by the chosen Ruby implementation.
You will not be able to run Sinatra on Cardinal, SmallRuby, BlueRuby or any Ruby version prior to 1.8.7 as of the time being.
If you would like to use Sinatra’s latest bleeding code, feel free to run your application against the master branch, it should be rather stable.
We also push out prerelease gems from time to time, so you can do a
gem install sinatra --pre
To get some of the latest features.
If you want to run your application with the latest Sinatra, using Bundler is the recommended way.
First, install bundler, if you haven’t:
gem install bundler
Then, in your project directory, create a Gemfile:
source :rubygems gem 'sinatra', :git => "git://github.com/sinatra/sinatra.git" # other dependencies gem 'haml' # for instance, if you use haml gem 'activerecord', '~> 3.0' # maybe you also need ActiveRecord 3.x
Note that you will have to list all your applications dependencies in there. Sinatra’s direct dependencies (Rack and Tilt) will, however, be automatically fetched and added by Bundler.
Now you can run your app like this:
bundle exec ruby myapp.rb
Create a local clone and run your app with the sinatra/lib directory on the $LOAD_PATH:
cd myapp git clone git://github.com/sinatra/sinatra.git ruby -Isinatra/lib myapp.rb
To update the Sinatra sources in the future:
cd myapp/sinatra git pull
You can build the gem on your own:
git clone git://github.com/sinatra/sinatra.git cd sinatra rake sinatra.gemspec rake install
If you install gems as root, the last step should be
sudo rake install
Sinatra follows Semantic Versioning, both SemVer and SemVerTag.
Project Website - Additional documentation, news, and links to other resources.
Contributing - Find a bug? Need help? Have a patch?
Sinatra Book Cookbook Tutorial
Sinatra Book Contrib Community contributed recipes
API documentation for the latest release or the current HEAD on rubydoc.info
Generated with the Darkfish Rdoc Generator 1.1.6.


Pageable backgrid + Backbone.PaginationCollection example
Uses collections with randomly generated titles. May contain duplicates.
Pageable backgrid using Backbone.PaginationCollection as source.


Language diversity
-use tooltip to check content-type and count
Languages:
English
Lithuanian
Spanish
Galician
Italian
Romanian
Finnish
French
Norwegian
Portuguese
Danish
German
Esperanto
Estonian
Hungarian
Russian
Slovaksk
Swedish
Catalan
Greek
Persian
Dutch
Polish
Thai
Ukranian


Class: Sketchup::ShadowInfo
| Relationships | |
| Super Chains via Extension / Inclusion / Inheritance | |
|
Class Chain:
self,
Entity
|
|
|
Instance Chain:
self,
Enumerable,
Entity
|
|
| Inherits: |
Sketchup::Entity
|
Overview
The ShadowInfo
class contains method to extract the shadow information for a model. The majority of the shadow information returned exists in the Model
Info > Location and Model
Info > Shadows dialogs inside SketchUp.
The following shadow information keys are maintained in SketchUp:
-
City
(inModel
Info > Geo-location >Set
Manual Location…) Note that ‘City’ is called ‘Location’ in the UI -
Country
(inModel
Info > Geo-location >Set
Manual Location…) -
Dark
(in Window > Shadows) -
DayOfYear
-
DaylightSavings
-
DisplayNorth
-
DisplayOnAllFaces
(in Window > Shadows) -
DisplayOnGroundPlane
(in Window > Shadows) -
DisplayShadows
(in Window > Shadows) -
EdgesCastShadows
(in Window > Shadows) -
Latitude
(inModel
Info > Geo-location >Set
Manual Location…) -
Light
(in Window > Shadows) -
Longitude
(inModel
Info > Geo-location >Set
Manual Location…) -
NorthAngle
-
ShadowTime
(in Window > Shadows) -
ShadowTime_time_t
(ShadowTime in Epoch time) -
SunDirection
(Generated based on ShadowTime) -
SunRise
(Generated based on ShadowTime) -
SunRise_time_t
(SunRise in Epoch time) -
SunSet
(Generated based on ShadowTime) -
SunSet_time_t
(SunSet in Epoch time) -
TZOffset
(in Window > Shadows) -
UseSunForAllShading
(in Window > Shadows)
You access the ShadowInfo
object by calling Model#shadow_info:
Class Method Summary
-
.each_key {|key| ... } ⇒ nil
The #each_key method iterates through all of the shadow information keys.
-
.keys ⇒ Array<String>
The keys method is a class method that returns an array with all of the attribute keys.
Instance Attribute Summary
Entity
- Inherited
Instance Method Summary
-
#[](key) ⇒ Object?
The [] method retrieves a value from the array of keys.
-
#[]=(key, value) ⇒ Object
The set value []= method is used to set the value in the array of shadow info options.
-
#add_observer(observer) ⇒ Boolean
The add_observer method is used to add an observer to the current object.
-
#count ⇒ Integer
The count method is inherited from the Enumerable mix-in module.
-
#each {|key, value| ... } ⇒ nil
The #each method iterates through all of the shadow information key/value pairs.
-
#each_key {|key| ... } ⇒ nil
The #each_key method iterates through all of the shadow information keys.
-
#each_pair {|key, value| ... } ⇒ nil
The #each_pair method is an alias for #each.
-
#keys ⇒ Array<String>
The keys method is a class method that returns an array with all of the attribute keys.
-
#length ⇒ Integer
The #length method returns the number of options in the shadow options collection.
-
#remove_observer(observer) ⇒ Boolean
The remove_observer method is used to remove an observer from the current object.
- #size ⇒ Integer
Entity
- Inherited
| #add_observer | The add_observer method is used to add an observer to the current object. |
| #attribute_dictionaries | The attribute_dictionaries method is used to retrieve the |
| #attribute_dictionary | The attribute_dictionary method is used to retrieve an attribute dictionary with a given name that is attached to an |
| #delete_attribute | The |
| #entityID | The entityID method is used to retrieve a unique ID assigned to an entity. |
| #get_attribute | The |
| #inspect | The to_s method is used to retrieve the string representation of the entity. |
| #model | The model method is used to retrieve the model for the entity. |
| #parent | The parent method is used to retrieve the parent of the entity. |
| #persistent_id | The |
| #remove_observer | The remove_observer method is used to remove an observer from the current object. |
| #set_attribute | The set attribute is used to set the value of an attribute in an attribute dictionary with the given name. |
| #to_s | The to_s method is used to retrieve the string representation of the entity. |
| #typename | The typename method retrieves the type of the entity, which will be a string such as “Face”, “Edge”, or “Group”. |
Class Method Details
.each_key {|key| ... } ⇒ nil
The #each_key method iterates through all of the shadow information keys.
.keys ⇒ Array<String>
The keys method is a class method that returns an array with all of the attribute keys
Instance Method Details
#[](key) ⇒ Object
?
The [] method retrieves a value from the array of keys
#[]=(key, value) ⇒ Object
The set value []= method is used to set the value in the array of shadow info options.
#add_observer(observer) ⇒ Boolean
The add_observer method is used to add an observer to the current object.
#count ⇒ Integer
The count method is inherited from the Enumerable mix-in module.
#each {|key, value| ... } ⇒ nil
The #each
method iterates through all of the shadow information key/value pairs.
#each_key {|key| ... } ⇒ nil
The #each_key
method iterates through all of the shadow information keys.
#each_pair {|key, value| ... } ⇒ nil
The #each_pair
method is an alias for #each.
#keys ⇒ Array<String>
The keys method is a class method that returns an array with all of the attribute keys
#length ⇒ Integer
The #length
method returns the number of options in the shadow options collection
#remove_observer(observer) ⇒ Boolean
The remove_observer method is used to remove an observer from the current object.
#size ⇒ Integer
The #size
method is an alias for #length.


Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.
We Empower YOU
Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
How We Build
Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition.
Let's Build Together
Leverage agile frameworks to provide a robust synopsis for high level overviews. Iterative approaches to corporate strategy foster collaborative thinking to further the overall value proposition. Organically grow the holistic world view of disruptive innovation via workplace diversity and empowerment.


Events
March 2019
Mar
13
6:55pm
to
11:00pm
Urban NY Spring 2019: The Metropolitan Opera: Samson et Delilah
Mar
14
4:00pm
to
5:00pm
Study Abroad Dialogue Series: LGBTQ
5:00pm
to
7:00pm
Columbia Connects
5:00pm
to
7:00pm
Columbia Connects
Mar
15
3:00pm
to
5:00pm
A Celebration of the Life of Professor Edward W. Tayler
3:30pm
to
4:30pm
FiF Programs: Research & Fellowships Info Session
Mar
25
11:00am
to
1:00pm
Succulent Study Break
6:30pm
to
8:30pm
Alumni-Hosted Dinner Week Lottery: Chris Wong CC'02
Mar
27
5:35pm
to
7:00pm
Urban NY Spring 2019: Mean Girls
6:00pm
to
7:30pm
Be the "1st" Dinner
6:00pm
to
8:00pm
Alumni-Hosted Dinner Week Lottery: Merrie Milstein CC'09
Mar
28
5:00pm
to
7:00pm
Columbia Connects
5:00pm
to
7:00pm
Columbia Connects
5:55pm
to
10:00pm
Urban NY Spring 2019: Frozen
6:00pm
to
8:00pm
Alumni-Hosted Dinner Week Lottery: Sharene Wood CC'94
6:15pm
to
10:30pm
Urban NY Spring 2019: Knicks vs Raptors
6:30pm
to
8:30pm
ROOTED Dinner & Dialogue: "How does your community service serve you?"
Mar
29
12:30pm
to
1:30pm
FiF Programs: Study Abroad Information Session
12:30pm
to
1:30pm
FiF Programs: Study Abroad Information Session
2:00pm
to
4:00pm
CCW Snack and Learn: Viacom
2:00pm
to
4:00pm
CCW Snack and Learn: Viacom
7:30pm
to
9:30pm
Alumni-Hosted Dinner Week Lottery: Jason Allegrante CC'07
11:55pm
to
12:55am
Multicultural Affairs Advisory Council Application: 2019-2020 (Due March 29)
April 2019
Apr
2
5:50pm
to
10:00pm
Urban NY Spring 2019: Pretty Woman
6:00pm
to
8:00pm
Industry Showcase: Book Publishing 2019
Apr
3
6:55pm
to
11:00pm
Urban NY Spring 2019: Dear Evan Hansen
Apr
4
12:00pm
to
1:00pm
Join the CC-SEAS Integrity Undergraduate Advisory Group!
4:00pm
to
5:00pm
Global Engagement Dialogue Series: Students of Color
5:45pm
to
10:00pm
Urban NY Spring 2019: Be More Chill
Apr
5
6:45pm
to
11:00pm
Urban NY Spring 2019: Ain't Too Proud
Apr
7
2:00pm
to
4:00pm
CCYA - A Paint & Sip
Apr
8
(All day)
Columbia College Days: April 8-12
12:00pm
to
2:00pm
Class of 2022 Spirit Photo and College Days Celebration
6:30pm
to
8:30pm
My Columbia College Journey Dinner
Apr
9
12:00pm
to
2:00pm
Class of 2021 Spirit Photo and College Days Celebration
5:00pm
to
7:00pm
Columbia College Days: Cake Wars
5:50pm
to
11:00pm
Urban NY Spring 2019: Wicked
5:50pm
to
10:00pm
Urban NY Spring 2019: King Kong
Apr
10
12:00pm
to
2:00pm
Class of 2020 Spirit Photo and College Days Celebration
1:00pm
to
2:30pm
What's on your mind?: Queer/Transing Self Care and Mental Health
4:30pm
to
8:00pm
Urban NY Spring 2019: Aerial Arts NYC: Private Group Class
6:00pm
to
7:30pm
Student and Faculty of Color Dinner
6:00pm
to
7:30pm
Class of 2019 Columbia Alumni Center Open House
8:00pm
to
10:00pm
Columbia College Days: King's Ball
Apr
11
10:15am
to
1:00pm
FiF Programs: Career Day @ New York Presbyterian/Columbia
12:00pm
to
2:00pm
Class of 2019 Spirit Photo and College Days Celebration
6:30pm
to
8:30pm
ROOTED Dinner & Dialogue: "Does your gender enter the party before you do?"
8:00pm
to
10:00pm
Columbia College Days: Glow Sticks
Apr
12
12:00pm
to
2:30pm
Columbia College Days: Food Trucks
2:00pm
to
3:30pm
Sophomore Fridays: Identify and Leverage Your Strengths
6:55pm
to
11:00pm
Urban NY Spring 2019: Dance Theatre of Harlem
Apr
13
7:20pm
to
11:00pm
Urban NY Spring 2019: The Metropolitan Opera: La Traviata
Apr
15
(All day)
Summer 2019 Work Exemption Program Application Deadline
(All day)
2019 Summer Funding Program Application Deadline
10:00am
to
12:00pm
Tax Day Tabling
Apr
16
9:30am
to
11:00am
FiF Programs Doughnuts & Direction: Fall 2019 Group Advising
Apr
17
5:00pm
to
7:00pm
Identity and Culture Abroad: Preparing for the Unexpected
5:40pm
to
9:00pm
Urban NY Spring 2019: Empire State
Apr
18
4:55pm
to
9:00pm
Urban NY Spring 2019: City Cooking West End: Pasta Making Class
5:00pm
to
8:00pm
RHLO Send Off 2019
6:30pm
to
8:30pm
ROOTED Dinner & Dialogue: "How does class show up in between classes?"
7:00pm
to
9:00pm
CCW Toast to Graduating Seniors 2019
Apr
19
12:00pm
to
1:00pm
How to Prepare For Finals
1:00pm
to
2:30pm
GEN Week - CCE Meet and Greet
6:55pm
to
11:00pm
Urban NY Spring 2019: Beetlejuice
Apr
23
12:00pm
to
1:00pm
Aquiline Capital Partners - Private Equity Info Session
4:10pm
to
5:10pm
Columbia in Kenya Info Session
Apr
25
5:55pm
to
10:00pm
Urban NY Spring 2019: Cher
6:30pm
to
8:30pm
ROOTED Dinner & Dialogue: "Do your values fit on your resume?"
7:30pm
to
9:30pm
Outdoor Movie Night: Spider-Man Into the Spider-Verse
Apr
26
2:00pm
to
3:00pm
FiF Programs: Prepping for Finals
3:30pm
to
5:00pm
Q Splash: A Queer-friendly, Body-Positive Pool Party & CC Swim Test
6:30pm
to
9:30pm
FiF Programs: Passage @ Soho Rep
May 2019
May
2
12:00pm
to
1:00pm
Join the CC-SEAS Integrity Undergraduate Advisory Group!
5:45pm
to
10:00pm
Urban NY Spring 2019: Come From Away
May
3
6:55pm
to
10:00pm
Urban NY Spring 2019: Jazz @ Lincoln Center: Ellington Through the Ages
May
7
7:30pm
to
9:30pm
Columbia College Senior Dinner
May
8
6:00pm
to
8:30pm
Lavender Graduation for Undergraduates
May
9
6:00pm
to
8:00pm
Asian Graduation for Undergraduates
May
10
6:30pm
to
8:30pm
CCW Signature Event
May
17
5:40am
to
9:00am
FiF Programs: The Tempest @ The Public Theater
May
20
5:30pm
to
7:00pm
Legacy Reception
6:00pm
to
8:00pm
First-Generation Low Income (FLI) for Undergraduates
6:00pm
to
8:00pm
First-Generation Low Income (FLI) for Undergraduates
May
21
7:00am
to
10:30am
Parade of Classes at Columbia College Class Day
7:00am
to
10:30am
Parade of Classes at Columbia College Class Day
8:00am
to
10:30am
Columbia College Class Day
2:00pm
to
5:00pm
Black Graduation for Undergraduates
2:00pm
to
5:00pm
Black Graduation for Undergraduates
7:00pm
to
9:30pm
Raza Graduation for Undergraduates
May
22
1:00pm
to
3:00pm
FiF Programs Graduation Reception
2:00pm
to
4:00pm
Native Graduation for Undergraduates
2:00pm
to
4:00pm
Native Graduation for Undergraduates
May
30
4:00pm
to
11:55pm
Reunion Weekend 2019
4:00pm
to
11:55pm
Reunion Weekend 2019


public class AmazonFreeRTOSDevice
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
void |
deleteNetwork(DeleteNetworkReq deleteNetworkReq,
NetworkConfigCallback callback)
Sends a DeleteNetworkReq command to the connected BLE device.
|
void |
editNetwork(EditNetworkReq editNetworkReq,
NetworkConfigCallback callback)
Sends an EditNetworkReq command to the connected BLE device.
|
boolean |
equals(java.lang.Object obj) |
void |
getBrokerEndpoint(DeviceInfoCallback callback)
Get the current broker endpoint on the device.
|
void |
getDeviceVersion(DeviceInfoCallback callback)
Get the AmazonFreeRTOS library software version running on the device.
|
void |
getMtu(DeviceInfoCallback callback)
Get the current mtu value between device and Android phone.
|
void |
listNetworks(ListNetworkReq listNetworkReq,
NetworkConfigCallback callback)
Sends a ListNetworkReq command to the connected BLE device.
|
void |
saveNetwork(SaveNetworkReq saveNetworkReq,
NetworkConfigCallback callback)
Sends a SaveNetworkReq command to the connected BLE device.
|
public void listNetworks(ListNetworkReq listNetworkReq, NetworkConfigCallback callback)
listNetworkReq
- The ListNetwork requestcallback
- The callback which will be triggered once the BLE device sends a ListNetwork
response.public void saveNetwork(SaveNetworkReq saveNetworkReq, NetworkConfigCallback callback)
saveNetworkReq
- The SaveNetwork request.callback
- The callback that is triggered once the BLE device sends a SaveNetwork response.public void editNetwork(EditNetworkReq editNetworkReq, NetworkConfigCallback callback)
editNetworkReq
- The EditNetwork request.callback
- The callback that is triggered once the BLE device sends an EditNetwork response.public void deleteNetwork(DeleteNetworkReq deleteNetworkReq, NetworkConfigCallback callback)
deleteNetworkReq
- The DeleteNetwork request.callback
- The callback that is triggered once the BLE device sends a DeleteNetwork response.public void getMtu(DeviceInfoCallback callback)
callback
- The callback to notify app of current mtu value.public void getBrokerEndpoint(DeviceInfoCallback callback)
callback
- The callback to notify app of current broker endpoint on device.public void getDeviceVersion(DeviceInfoCallback callback)
callback
- The callback to notify app of current software version.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object


In networking, a packet is a small segment of a larger message. Each packet contains both data and information about that data. The information about the packet's contents is known as the "header," and it goes at the front of the packet so that the receiving machine knows what to do with the packet.
When data gets sent over the Internet, it is first broken up into smaller packets, which are then translated into bits. The packets get routed to their destination by various networking devices such as routers and switches. When the packets arrive at their destination, the receiving device reassembles the packets in order and can then use or display the data.
Before we cover what the Internet is, we must define what a "network" is. A network is a group of connected computers that are able to send data to each other. A computer network is much like a social circle, which is a group of people who all know each other, regularly exchange information, and coordinate activities together.
The Internet is a vast, sprawling collection of networks that connect to each other. In fact, the word "Internet" comes from this concept: interconnected networks.
Connecting two computers, both of which may use different hardware and run different software, is one of the main challenges that the creators of the Internet had to solve. It requires the use of communications techniques that are understandable by all connected computers.
This problem is solved with standardized protocols. In networking, a protocol is a standardized way of doing certain actions and formatting data so that two or more devices are able to communicate with and understand each other.


This is the user zone
Only authenticated users with role USER are allowed to see this page.
Are you sure you want to delete this note?
Add Note
Click here to go to home.


{%- extends "layout.html" %} {% set title = _('Page not Found') %} {% block body %}
The page you requested does not exist. Maybe you followed a bad link or the resource was removed.
Maybe the documentation overview might be able to help you. {% endblock %}


foody bag
The pleasure of variety at your place,
|
See Menu
1
2
3
Previous
Next
Home
About
Features
foody bag
Menu
Events
Reservation
What Are You Craving for?
Fruits
Sea food
Vegetables
Meat
Can't Decide?
Let The Fortune Wheel Decide!
Opps! Your browser does't support Canvas.
$ 100.00
Show Menu
Fortune Food
Subscribe Us!


Agile is a collection of general values and principles about software production.
Agile practices aim to create adaptive environments & self-organizing teams.
Scrum is one formal implementation of Agile principles (there are others).
Sequential, phased approach to production.
Assumes all requirements are known upfront.
Emulates a manufacturing assembly line.
Prescriptive production process.
Iterative, incremental approach to production.
Assumes requirements will continously change.
Creates an environment for adaptive, local processes to emerge.
Empirical approach to production
Agile derives from adaptive systems theory.
In complex systems, adaptive patterns emerge through simple interactions & iteration.
Teams, clients and changing needs represent unique, complex ecosystems.
Scrum (n): A framework within which people can address complex adaptive problems, while productively and creatively delivering products of the highest possible value.
Self-organizing teams.
Inspection & adaptation.
Transparency.
Deliver early, deliver often.
Scrum environments contain three distinct roles:
The Product Owner.
The Scrum Master.
The Scrum Team.
The single owner of the product.
Solely responsible for managing and prioritizing the product backlog.
In project environments, this role is usually filled client-side.
The servant-leader role.
Facilitates and teaches Scrum practices.
Protects the team from external distractions.
Self-organizing.
Inspects, adapts and improves through regular review of progress.
Determines how and when to transform user stories into finished features.
Fully committed to a single project.
The tools used to manage and represent work.
All artifacts are transparent & public.
Master list of requirements ordered by priority.
Living artifact, changes as product evolves.
Items can be added or re-prioritized at any time.
Regularly groomed by entire Scrum team.
Fixed set of items the team commits to finish during the sprint.
Items selected based on highest priority in product backlog.
Does not change during sprint for any reason.
Visual representation of work plotted against time remaining in sprint.
Burn-down chart tracks remaining work.
Burn-up chart tracks completed work.
Scrum is defined by regular, formal opportunities for inspection and adaptation.
All events are designed to maximize critical transparency.
All events are time-boxed to prevent waste.
Container for all Scrum events and work.
Begins with sprint planning and ends with sprint retrospective.
Time-boxed (usually 1-4 weeks).
Dedicated to a set of fixed goals.
Team selects highest priority items from product backlog to complete during sprint.
Decomposes each item into tasks & assigns hour estimates using estimation techniques.
Items selected are put into sprint backlog.
Timeboxed daily meeting for all team members.
Meeting consists of three questions:
Review at the end of every sprint with stakeholders.
Demonstrate completed work & gather feedback.
Peform any adjustments to product backlog.
Forensic review of the completed sprint.
Inspect team dynamics, process & tools to reveal inefficiences.
Identify what did and didn't work during the sprint.
Make adjustments for next sprint.
Team creates shared definition of "done"
Used to assess when work is complete.
Example: design complete, unit tested, code checked in, etc.


SEND FUND
if the list is empty check that the server is running and add flights!
UPDATE FLIGHTS LIST
UPDATE BALANCE CLAIM PREMIUM


| All projects share one version of the dependency. | |
| At least one project has a differing version of the dependency. |
| Number of sub-projects: | 11 |
|---|---|
| Number of dependencies (NOD): | 33 |
| Number of unique artifacts (NOA): | 35 |
| Number of SNAPSHOT artifacts (NOS): | 0 |
| Convergence (NOD/NOA): | 94% |
| Ready for Release (100% Convergence and no SNAPSHOTS): | Error You do not have 100% convergence. |


Tip calculator
How much was your bill?
How was your service?
Choose an option
Excellent
Good
Regular
Bad
How many people are sharing the bill?
Calculate


All the numbers you need on brew day.
Version 2.5
Choose your units.
 Brew Day: 6/8/2016 Remember to clean as you go!..."
Feedback
Measured Conversion Efficiency
Feedback Score
3.00
%
4.57
/ 10
Measured Lauter Efficiency
Feedback Score
92
%
9
/ 10
Measured Sparge Efficiency
Feedback Score
92
%
9
/ 10
Measured Mash Efficiency
Feedback Score
92
%
9
/ 10
Measured Brewhouse
Feedback Score
92
%
9
/ 10
Efficiency Estimation vs Grain Bill Curves


Plugin Information |
|---|
View Pre SCM BuildStep on the plugin site for more information. |
This plugin allows build step to run before SCM checkouts so that you perform any build step action on the the workspace, (cleanup, add a file with some settings for the SCM, etc) or call other scripts that need to be run before checking out from the SCM.
Configuration example
This plugin was written to provide a build step point where a perl script can be run after detecting changes in the polling but before the SCM does the checkout. To make it more usable and flexible it was decided to allow any number of build steps to be added and called.
Warnings on the use of this plugin
Be Careful
- The SCM may modify or remove any files that are in the workspace, before the main build steps.
- Enviroment variables may not exist at this point, if they are created by other plugins, check using a shell script and the env (unix) or equivalent for your executor system.
Warning
- IMPORTANT: Failed build steps will not cause the job to fail at this point, and all build steps will be called regardless of the result.
History
Version 0.2 (Feb 19, 2012)
- Fixed Issue JENKINS-12770
Version 0.1 (Aug 23, 2011)
- First release
Attachments:
pre_scm_buildstep_config.png (image/png)


Irish Comedy Panel Show Gender By Year
Key:
male
female
other/diverse
By
@astronomyblog
.
Last updated 25 April 2016
Year
Gender split
Ratio
Appearances
1998
89:11
76
1999
84:16
45
2003
67:33
9
2016
68:32
41
All
67:33
9


William P. Lehman
2538 Silverado St, West Sacramento, CA 95691 | ph:<PHONE_NUMBER> | email<EMAIL_ADDRESS>Summary
An experienced multi-discipline team lead interested in leading creative teams towards collaborative solutions. Passionate about navigating systems of organizational structure, political forces, team dynamics, and technical requirements to architect technical and cultural systems that deliver relevant products on time and under budget. Capable of driving calculated risk-taking behavior to help organizations meet their strategic goals in support of their mission and vision.
Experience
Risk Management
Developed a Risk Profile, Risk Assessment, and Risk Appetite for HEC
Formally proposed a Risk Management Community of Practice for USACE
Participated in writing Enterprise Risk Management and Risk Informed Decision-Making policy and implementation plans for USACE
Computer Programming
Visual Basic (7 years) – Java (5 years) – C# (4 years) – JavaScript, HTML, CSS (2 years)
Object Oriented Programming – SOLID design principles – Test Driven Design – Design Patterns – Object Relational Mapping – Model View ViewModel design architecture
Visual Studio – Netbeans – Eclipse – Visual Studio Code
Software Development Project Management
Led HEC-FIA (Flood Impact Analysis) (8 years) – Led HEC-WAT (Watershed Analysis Tool) (1 year)
Scoped projects – wrote contracts – researched new methodologies – tested deliverables – wrote technical, application, and user documentation.
Jira administrator – Gemini administrator – Discourse administrator
BitBucket – GitHub – Git – Perforce – P4V
Leadership
Participated in Emerging Leaders Program
Led “Young Visionaries” at HEC initializing many technical and cultural change initiatives
Created and led a Software Developers Community of Practice for USACE
Led brainstorming, design, and scoping meetings
Communication and Teaching
Taught, created, and coordinated many training courses.
Excellent oral presentation skills utilized at many conferences and training courses.
Work History
Economist, Hydrologic Engineering Center USACE, Davis, CA, 2009-Present
Department of the Army Economist Intern, SWL District USACE, Little Rock, AR, 2008-2009
Education and Credentials
M.S. Risk Management, 2019
Notre Dame Maryland University, Baltimore, MD
M.S. Economics, 2008
Oklahoma State University, Stillwater, OK
B.A. Economics, 2008
Oklahoma State University, Stillwater, OK
B.A. Mathematics, 2008
Oklahoma State University, Stillwater, OK
Awards
IWR Product of the Year HEC-FIA 2011
IWR Scientific Achievement HEC-FIA 3.0 2013
IWR Product of the Year HEC-WAT 1.0 2017
IWR Team Award Trinity River Team 2018


ChessPiece – This class is a blueprint of a chess piece object. These objects can be placed on boards of type 'Board'. Each ChessPiece object contains a pos (position) and a boolean 'player1' indicating whether it belongs to player 1 or not. The 'pos' is a 1-D int[] containing the piece's position on a multi-dimensional Board.
- Author
- sahil1105
◆ ChessPiece()
| ChessPiece.ChessPiece |
( |
@NotNull int [] |
pos, |
|
|
boolean |
player1 |
|
) |
| |
Constructor for the ChessPiece class.
- Parameters
-
| pos | The postion of the ChessPiece object |
| player1 | 'true' if the piece belongs to player 1, false otherwise. |
◆ canMoveToPos()
| boolean ChessPiece.canMoveToPos |
( |
@NotNull Board |
gameBoard, |
|
|
int [] |
pos |
|
) |
| |
Utility function which checks whether a piece can be moved to a certain point (in one step). Doesn't check for move legality (will return true even if the move leads to a check for the player in the next step).
- Parameters
-
| gameBoard | The Board object that the ChessPiece is currently on. Is not modified. |
| pos | The position to move the ChessPiece object to on the |
- Returns
- boolean indicating whether or not the ChessPiece has the ability to move to a 'pos' on the Board.
◆ getPieceIcon()
| Image ChessPiece.getPieceIcon |
( |
| ) |
|
Getter for the piece icon for this piece.
- Returns
- Image corresponding to this piece
◆ getPos()
| int [] ChessPiece.getPos |
( |
| ) |
|
Getter for the 'pos' variable of the ChessPiece class.
- Returns
- the position ('pos') vector of the ChessPiece object.
◆ getPossibleMoves()
| abstract List ChessPiece.getPossibleMoves |
( |
@NotNull Board |
gameBoard | ) |
|
|
abstract |
Function that enumerates all the possible moves that this ChessPiece can make, given its current position and the state of the board. Expected to be implemented by each of the children classes separately.
- Parameters
-
| gameBoard | The Board object that the piece is placed on |
- Returns
- List of positions on the Board object that this piece can move to.
◆ incrementedInDirection()
| static int [] ChessPiece.incrementedInDirection |
( |
@NotNull int [] |
pos, |
|
|
@NotNull int [] |
incrementVector |
|
) |
| |
|
static |
Utility function that wraps around the above 'incrementInDirection' function. Used when the original 'pos' vector is not to be modified.
- Parameters
-
| pos | The starting array to which the increment is to be made. Is not modified. |
| incrementVector | The increments to make in each dimension. Is not modified. |
- Returns
- An array which is a copy of the 'pos' array incremented in the 'incrementVector' direction.
◆ incrementInDirection()
| static void ChessPiece.incrementInDirection |
( |
@NotNull int [] |
next_pos, |
|
|
@NotNull int [] |
incrementVector |
|
) |
| |
|
static |
Utility function that increments the 'next_pos' array, by the corresponding element in the 'incrementVector' array If the lengths of the two arrays is not equal, the increments are made to either all the dimensions that an increment has been specified for, or can be made in overall (min(length(next_pos), length(incrementVector))).
- Parameters
-
| next_pos | The array to increment. Is modified. |
| incrementVector | The increments to make in each dimension. Is not modified. |
◆ isPlayer1()
| boolean ChessPiece.isPlayer1 |
( |
| ) |
|
Getter for the 'player1' boolean variable of the ChessPiece class.
- Returns
- player1 : The boolean vector indicating whether the piece belongs to player 1 or player 2. 'true' for player 1, 'false' for player 2.
◆ possibleMovesHelper()
| void ChessPiece.possibleMovesHelper |
( |
@NotNull Board |
gameBoard, |
|
|
@NotNull List< int[]> |
possibleMoves, |
|
|
@NotNull int [] |
direction, |
|
|
boolean |
multipleSteps |
|
) |
| |
|
protected |
Wrapper function to the above two functions. Redirected to the multipleSteps version if the boolean 'multipleSteps' is true, otherwise to the single_step version.
- Parameters
-
| gameBoard | The Board object that the ChessPiece is currently on. Is not modified. |
| possibleMoves | A list of int[] objects to add to. Is modified. |
| direction | A direction vector indicating the step to take. Is not modified. |
| multipleSteps | boolean indicating whether to try multiple steps in the specified direction or take a single step in the direction |
◆ possibleMovesHelper_multipleSteps()
| void ChessPiece.possibleMovesHelper_multipleSteps |
( |
@NotNull Board |
gameBoard, |
|
|
@NotNull List< int[]> |
possibleMoves, |
|
|
@NotNull int [] |
direction |
|
) |
| |
|
protected |
A helper function which adds to the possibleMoves list all the moves that the ChessPiece can make from its current position in a given particular direction. direction[i] specifies the number of steps to take in each direction at any point. Keeps going until either goes outside the board, or hits an obstacle (another piece). Includes move that captures an opponents piece.
- Parameters
-
| gameBoard | The Board object that the ChessPiece is currently on. Is not modified. |
| possibleMoves | A list of int[] objects to add to. Is modified. |
| direction | A direction vector indicating the direction to move in. Is not modified. |
◆ possibleMovesHelper_singleStep()
| void ChessPiece.possibleMovesHelper_singleStep |
( |
@NotNull Board |
gameBoard, |
|
|
@NotNull List< int[]> |
possibleMoves, |
|
|
@NotNull int [] |
direction |
|
) |
| |
|
protected |
A helper function which adds to the possibleMoves list a move in the 'direction' direction from the ChessPiece's current location, if it is a valid move, i.e. either it is empty or has an opponent's piece on it.
- Parameters
-
| gameBoard | The Board object that the ChessPiece is currently on. Is not modified. |
| possibleMoves | A list of int[] objects to add to. Is modified. |
| direction | A direction vector indicating the step to take. Is not modified. |
◆ rotate()
| static Image ChessPiece.rotate |
( |
Image |
original | ) |
|
|
static |
◆ setFirstTwoDims()
| static void ChessPiece.setFirstTwoDims |
( |
@NotNull int [] |
vector, |
|
|
int |
dim1, |
|
|
int |
dim2 |
|
) |
| |
|
static |
Utility function to set the first two elements of an int[].
- Parameters
-
| vector | The integer array to modify. Is modified. |
| dim1 | The integer to set vector[0] to. |
| dim2 | The integer to set vector[1] to. Returns without effect if the size of the vector is less than 2. |
◆ setPos()
| void ChessPiece.setPos |
( |
@NotNull int [] |
pos | ) |
|
Setter for the 'pos' variable of the ChessPiece class.
- Parameters
-
◆ toString()
| abstract String ChessPiece.toString |
( |
| ) |
|
|
abstract |
- Returns
- String representation of the ChessPiece object. Expected to be implemented by the children classes.
◆ pieceIcon
| Image ChessPiece.pieceIcon |
|
protected |
A 64x64 image for this piece.
◆ player1
| final boolean ChessPiece.player1 |
|
protected |
Boolean variable specifying whether this piece belongs to player1 or not. Cannot be changed after instantiation.
◆ pos
Integer array containing the multi-dimensional vector specifying the ChessPiece's location on the Board
The documentation for this class was generated from the following file:


De Re Metallica
De Re Metallica, by Georgius Agricola (Georg Pawer) was one of the earliest books on metallurgy and mining to be based on observation, rather than relying on the word of others or personal speculation. Published in 1556, it was illustrated with woodcuts based on on-site drawings by the artist Basilius Wefring.
For contemporary artist Justin Berry, the most fascinating features of the book are these woodcuts and the multiple levels on which they operate. Like all drawings from observation, they reveal more than they intend. Though their overt purpose is to show the mechanisms and implements of the mining process, they also show the world around those objects, such as the ground ripped open, the trees cut down, and the refuse of the mining process running off into the waterways.
By making the original subject of these drawings—the human intervention—vanish, Justin Berry creates a new illustration, which focuses on the landscape itself. We see a scene that appears to be the aftermath of a battle or the site of some natural catastrophe. Though in truth it is neither, perhaps in some ways it is both.


pip_services3_commons.config.NameResolver module¶
pip_services3_commons.config.NameResolver¶
Name resolver implementation
| copyright: | Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details. |
|---|---|
| license: | MIT, see LICENSE for more details. |
-
class
pip_services3_commons.config.NameResolver.
NameResolver
¶ Bases:
object
A helper class that allows to extract component name from configuration parameters. The name can be defined in “id”, “name” parameters or inside a component descriptor.
- Examples:
[code] config = ConfigParams.fromTuples(“descriptor”, “myservice:connector:aws:connector1:1.0”,
“param1”, “ABC”, “param2”, 123)name = NameResolver.resolve(config) [/code]
-
static
resolve
(config, default_name=None)¶ Resolves a component name from configuration parameters. The name can be stored in “id”, “name” fields or inside a component descriptor. If name cannot be determined it returns a defaultName.
Parameters: - config – configuration parameters that may contain a component name.
- default_name – (optional) a default component name.
Returns: resolved name or default name if the name cannot be determined.


This image is 200 pixels square.
This div has a width of 200 pixels and a height of 200 pixels.
This div has a width of 200 pixels and a height of 200 pixels plus a border of 5 pixels.
This div has a width of 200 pixels and a height of 200 pixels plus padding of 20 pixels and a border of 5 pixels.


Anne Barkett
Coming to us from an extensive design background, Anne Barkett has joined the ranks of our Wordpress team at CoLab, offering clients many years of technical expertise in addition to her aesthetic eye. Over the years, she has sought out new challenges and opportunities to hone her web-development skills. Anne’s entry to computer programming was through an old Apple IIC, and she eventually took herself on to HTML/CSS and later Wordpress. Her interest in design coupled with her technical curiosity and interest in self-employment made a position with CoLab seem like the perfect fit. Like many of us, Anne is also enthusiastic about the outdoors -- hiking and gardening, primarily -- and is an ardent lover of cats and the arts (who doesn’t love cats and the arts?). We’re excited to welcome her to the team, and look forward to supporting her continued development of design skills, in addition to our clients’ websites.


Pier 2: 6am-11pm
Pier 5: 6am-11pm
Pier 6 Volleyball Courts: 6am-11pm
Squibb Park & Bridge: 6am-11pm
99 Plymouth: 8am-11pm
Playgrounds are open dawn to dusk
The remainder of the park is open 6am-1am
Brooklyn Bridge Park is a world-class waterfront park with rolling hills, riverfront promenades, lush gardens, and spectacular city views.
Parking near Brooklyn Bridge Park is very limited. We highly recommend taking public transportation, biking or walking to the park. BBP is accessible by bus, subway and ferry.
Park Restrooms are located at Pier 1, Pier 2, Pier 6, Squib Park and Main Street


Unfortunetly, there are no specials being offered at this time.
From time to time, as a treat to our customers, lulu's likes to offer discounts as a thoughtful thanks to our customer for their patronage.
Click here to see our available discounts now!


Constructor
new Animation()
Extends
Members
id :string
The file's ID.
Type:
- string
- Inherited From:
- Source:
(nullable) message :Message
The message this file was included in, if any
Type:
- Message
- Inherited From:
- Source:
(nullable) mimeType :string
The animation's MIME type.
Type:
- string
- Source:
(nullable) name :string
The animation's name.
Type:
- string
- Source:
(nullable) path :string
The file's path.
Type:
- string
- Inherited From:
- Source:
(nullable) size :string
The file's size.
Type:
- string
- Inherited From:
- Source:
(nullable) thumbnail :string
The animation's thumbnail.
Type:
- string
- Source:
Methods
download(path) → {Promise.<string>}
Downloads the file to the specified path.
Parameters:
| Name | Type | Description |
|---|---|---|
path |
string | The path to store the files in |
- Inherited From:
- Source:
- See:
Returns:
The file path it was downloaded to
- Type
- Promise.<string>
fetchUrl() → {Promise.<string>}
Fetches the URL of the file.
- Inherited From:
- Source:
- See:
Returns:
- Type
- Promise.<string>