Class: Amber
- Inherits:
-
Object
- Object
- Amber
- Defined in:
- lib/amber.rb
Defined Under Namespace
Modules: DataDelegate Classes: Controller, Data, Http, Model, Route, RoutePath, Server, Storage, Switch, View
Instance Attribute Summary collapse
-
#option ⇒ Object
readonly
Returns the value of attribute option.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
Instance Method Summary collapse
-
#initialize ⇒ Amber
constructor
A new instance of Amber.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Amber
Returns a new instance of Amber.
4 5 6 7 8 9 10 11 |
# File 'lib/amber.rb', line 4 def initialize @route = Amber::Route.new @option = {} if block_given? yield self end end |
Instance Attribute Details
#option ⇒ Object (readonly)
Returns the value of attribute option.
2 3 4 |
# File 'lib/amber.rb', line 2 def option @option end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
2 3 4 |
# File 'lib/amber.rb', line 2 def route @route end |
Instance Method Details
#run ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/amber.rb', line 13 def run server_port = @option.has_key?("port") ? @option["port"] : 3001 @server = Amber::Server.new server_port @server.base = self @server.prepare @server.start end |