Class: Bobette::App
- Inherits:
-
Object
- Object
- Bobette::App
- Defined in:
- lib/bobette.rb
Instance Attribute Summary collapse
-
#buildable ⇒ Object
readonly
Returns the value of attribute buildable.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(buildable) ⇒ App
constructor
A new instance of App.
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
#buildable ⇒ Object (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 |