Class: Endpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/oncall/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(route) ⇒ Endpoint

Returns a new instance of Endpoint.



9
10
11
12
13
14
# File 'lib/oncall/cli.rb', line 9

def initialize(route)
  @route = route
  @config = {
    'develop' => { 'domain' => 'localhost', 'port' => 4567 }
  }
end

Class Method Details

.define(route, &block) ⇒ Object



24
25
26
# File 'lib/oncall/cli.rb', line 24

def Endpoint.define(route, &block)
  new(route).instance_eval(&block)
end

.run(filename) ⇒ Object



20
21
22
# File 'lib/oncall/cli.rb', line 20

def Endpoint.run(filename)
  Endpoint.new('').parse(filename)
end

Instance Method Details

#parse(filename) ⇒ Object



16
17
18
# File 'lib/oncall/cli.rb', line 16

def parse(filename)
  instance_eval File.read(filename)
end