Class: Rester::Service::Request

Inherits:
Rack::Request
  • Object
show all
Defined in:
lib/rester/service/request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Request

Returns a new instance of Request.



9
10
11
12
# File 'lib/rester/service/request.rb', line 9

def initialize(env)
  super
  _parse_path if valid?
end

Instance Attribute Details

#object_chainObject (readonly)

Returns the value of attribute object_chain.



7
8
9
# File 'lib/rester/service/request.rb', line 7

def object_chain
  @object_chain
end

#versionObject (readonly)

Returns the value of attribute version.



6
7
8
# File 'lib/rester/service/request.rb', line 6

def version
  @version
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/rester/service/request.rb', line 14

def valid?
  path.length < 256 && %r{\A/v\d+/(\w+/?)+\z}.match(path)
end