Class: Rad::Http

Inherits:
Object show all
Defined in:
lib/rad/http/_http.rb,
lib/rad/http/_require.rb

Defined Under Namespace

Classes: HttpAdapter, RackAdapter, Request, Response

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHttp

Returns a new instance of Http.



9
10
11
# File 'lib/rad/http/_http.rb', line 9

def initialize
  @rack_adapter, @http_adapter = Rad::Http::RackAdapter.new, Rad::Http::HttpAdapter.new
end

Instance Attribute Details

#browser_generated_formatsObject



7
# File 'lib/rad/http/_http.rb', line 7

def browser_generated_formats; @browser_generated_formats ||= [] end

#browser_generated_typesObject



6
# File 'lib/rad/http/_http.rb', line 6

def browser_generated_types; @browser_generated_types ||= [] end

#default_formatObject

Returns the value of attribute default_format.



8
9
10
# File 'lib/rad/http/_require.rb', line 8

def default_format
  @default_format
end

#hostObject

Returns the value of attribute host.



8
9
10
# File 'lib/rad/http/_require.rb', line 8

def host
  @host
end

#http_adapterObject (readonly)

inject environment: :environment



3
4
5
# File 'lib/rad/http/_http.rb', line 3

def http_adapter
  @http_adapter
end

#portObject

Returns the value of attribute port.



8
9
10
# File 'lib/rad/http/_require.rb', line 8

def port
  @port
end

#public_pathObject



13
14
15
# File 'lib/rad/http/_require.rb', line 13

def public_path
  @public_path || "#{rad.runtime_path}/public"
end

#rack_adapterObject (readonly)

inject environment: :environment



3
4
5
# File 'lib/rad/http/_http.rb', line 3

def rack_adapter
  @rack_adapter
end

#sessionObject

Returns the value of attribute session.



8
9
10
# File 'lib/rad/http/_require.rb', line 8

def session
  @session
end

#staticObject

Returns the value of attribute static.



8
9
10
# File 'lib/rad/http/_require.rb', line 8

def static
  @static
end

#url_rootObject

Returns the value of attribute url_root.



8
9
10
# File 'lib/rad/http/_require.rb', line 8

def url_root
  @url_root
end

Instance Method Details

#public_path?Boolean

Returns:

  • (Boolean)


16
# File 'lib/rad/http/_require.rb', line 16

def public_path?; !!public_path end

#static?Boolean

Returns:

  • (Boolean)


10
# File 'lib/rad/http/_require.rb', line 10

def static?; !!@static end