Class: CodeSync::Server::ServerInfo
- Inherits:
-
Object
- Object
- CodeSync::Server::ServerInfo
- Defined in:
- lib/code_sync/server.rb
Instance Attribute Summary collapse
-
#faye ⇒ Object
Returns the value of attribute faye.
-
#options ⇒ Object
Returns the value of attribute options.
-
#sprockets ⇒ Object
Returns the value of attribute sprockets.
Instance Method Summary collapse
- #allow_saving? ⇒ Boolean
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ ServerInfo
constructor
A new instance of ServerInfo.
- #to_s ⇒ Object
Constructor Details
#initialize(app, options = {}) ⇒ ServerInfo
Returns a new instance of ServerInfo.
196 197 198 199 200 |
# File 'lib/code_sync/server.rb', line 196 def initialize app, ={} @sprockets = [:sprockets] @faye = [:faye] @options = .dup end |
Instance Attribute Details
#faye ⇒ Object
Returns the value of attribute faye.
194 195 196 |
# File 'lib/code_sync/server.rb', line 194 def faye @faye end |
#options ⇒ Object
Returns the value of attribute options.
194 195 196 |
# File 'lib/code_sync/server.rb', line 194 def @options end |
#sprockets ⇒ Object
Returns the value of attribute sprockets.
194 195 196 |
# File 'lib/code_sync/server.rb', line 194 def sprockets @sprockets end |
Instance Method Details
#allow_saving? ⇒ Boolean
206 207 208 |
# File 'lib/code_sync/server.rb', line 206 def allow_saving? [:allow_saving] == true end |
#call(env) ⇒ Object
210 211 212 213 |
# File 'lib/code_sync/server.rb', line 210 def call(env) response = JSON.generate(project_assets: sprockets.project_assets, codesync_version: CodeSync::Version,paths:sprockets.env.paths, root:@options[:root], allow_saving: allow_saving?) [200, {"Access-Control-Allow-Origin"=>"*","Content-Type" => "application/json"}, [response]] end |
#to_s ⇒ Object
202 203 204 |
# File 'lib/code_sync/server.rb', line 202 def to_s "codesync server info" end |