class Thrifty::HTTP::Server::Builder

Public Class Methods

new() click to toggle source
# File lib/thrifty/http_server/builder.rb, line 4
def initialize
  require 'rack'
  require 'puma'

  @port = nil
  @ip   = nil
  @name = nil
end

Public Instance Methods

build(&block) click to toggle source
# File lib/thrifty/http_server/builder.rb, line 28
def build(&block)
  server = PumaServer.new(ip: @ip, port: @port, &block)
  server.start
  server
end
with_ip(value) click to toggle source
# File lib/thrifty/http_server/builder.rb, line 18
def with_ip(value)
  @ip = value
  self
end
with_name(value) click to toggle source
# File lib/thrifty/http_server/builder.rb, line 23
def with_name(value)
  @name = value
  self
end
with_port(value) click to toggle source
# File lib/thrifty/http_server/builder.rb, line 13
def with_port(value)
  @port = value.to_i
  self
end