Class: Bobette::App

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(buildable) ⇒ App

Returns a new instance of App.



11
12
13
# File 'lib/bobette.rb', line 11

def initialize(buildable)
  @buildable = buildable
end

Instance Attribute Details

#buildableObject (readonly)

Returns the value of attribute buildable.



9
10
11
# File 'lib/bobette.rb', line 9

def buildable
  @buildable
end

Instance Method Details

#call(env) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/bobette.rb', line 15

def call(env)
  payload   = env["bobette.payload"]

  @buildable.call(payload).each { |buildable|
    buildable.build if buildable.respond_to?(:build)
  }

  [200, {"Content-Type" => "text/plain"}, ["OK"]]
end