Class: Statusboard::StatusboardServer
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- Statusboard::StatusboardServer
- Defined in:
- lib/statusboard/server.rb
Overview
Simple Sinatra-based server whose task it is to serve widgets to the app(s) using http. Widgets can be defined directly using the DSL or by passing already initialized Widget-objects. The widgets are identified using a unique name for each defined widget.
Instance Attribute Summary collapse
-
#server_description ⇒ Object
readonly
Returns the value of attribute server_description.
Instance Method Summary collapse
-
#initialize(*args, &block) ⇒ StatusboardServer
constructor
Initializes a new instance of the server using the configuration specified via the DSL in the block.
Constructor Details
#initialize(*args, &block) ⇒ StatusboardServer
Initializes a new instance of the server using the configuration specified via the DSL in the block. The server will be initialized without any widgets if no block is specified.
16 17 18 19 20 21 |
# File 'lib/statusboard/server.rb', line 16 def initialize(*args, &block) super(*args, &nil) # Dont pass the block to super as it would result in errors because the dsl methods aren't available if not instance_eval'd @server_description = DSL::ServerDescription.new &block end |
Instance Attribute Details
#server_description ⇒ Object (readonly)
Returns the value of attribute server_description.
11 12 13 |
# File 'lib/statusboard/server.rb', line 11 def server_description @server_description end |