class RoadForest::Interface::Application
Attributes
data[R]
params[R]
path_provider[R]
response_values[R]
route_name[R]
services[R]
Public Class Methods
new(route_name, params, path_provider, services)
click to toggle source
# File lib/roadforest/interface/application.rb, line 12 def initialize(route_name, params, path_provider, services) @route_name = route_name @params = params @path_provider = path_provider @services = services @data = nil @response_values = {} end
Public Instance Methods
add_child(results)
click to toggle source
# File lib/roadforest/interface/application.rb, line 148 def add_child(results) raise NotImplementedError end
authentication_challenge()
click to toggle source
# File lib/roadforest/interface/application.rb, line 73 def authentication_challenge services.authz.challenge(:realm => "Roadforest") end
canonical_host()
click to toggle source
@!endgroup
# File lib/roadforest/interface/application.rb, line 79 def canonical_host services.canonical_host end
canonical_uri()
click to toggle source
# File lib/roadforest/interface/application.rb, line 41 def canonical_uri url_for(route_name, params) end
create_payload()
click to toggle source
# File lib/roadforest/interface/application.rb, line 140 def create_payload nil end
delete()
click to toggle source
# File lib/roadforest/interface/application.rb, line 157 def delete false end
error_data(status)
click to toggle source
group Resource
interface
# File lib/roadforest/interface/application.rb, line 88 def error_data(status) nil end
etag()
click to toggle source
# File lib/roadforest/interface/application.rb, line 96 def etag nil end
exists?()
click to toggle source
# File lib/roadforest/interface/application.rb, line 92 def exists? !data.nil? end
expires()
click to toggle source
# File lib/roadforest/interface/application.rb, line 132 def expires nil end
interface_for(route_name = nil, params = nil)
click to toggle source
# File lib/roadforest/interface/application.rb, line 37 def interface_for(route_name = nil, params = nil) path_provider.interface_for(route_name, params || self.params) end
last_modified()
click to toggle source
# File lib/roadforest/interface/application.rb, line 100 def last_modified nil end
my_path()
click to toggle source
# File lib/roadforest/interface/application.rb, line 45 def my_path path_for(route_name, params) end
my_url()
click to toggle source
# File lib/roadforest/interface/application.rb, line 49 def my_url canonical_uri.to_s end
path_for(route_name = nil, params = nil)
click to toggle source
@!group Utility
methods
# File lib/roadforest/interface/application.rb, line 25 def path_for(route_name = nil, params = nil) path_provider.path_for(route_name, params || self.params) end
pattern_for(route_name, vals = nil, extra = nil)
click to toggle source
# File lib/roadforest/interface/application.rb, line 33 def pattern_for(route_name, vals = nil, extra = nil) path_provider.pattern_for(route_name, vals, extra) end
processed()
click to toggle source
# File lib/roadforest/interface/application.rb, line 124 def processed [:location, :data].each do |key| unless @response_values.has_key?(key) @response_values[key] = nil end end end
required_grants(method)
click to toggle source
@!group Authorization
# File lib/roadforest/interface/application.rb, line 57 def required_grants(method) services.authz.build_grants do |grants| grants.add(:admin) end end
reset()
click to toggle source
# File lib/roadforest/interface/application.rb, line 83 def reset #XXX remove? end
response_data()
click to toggle source
# File lib/roadforest/interface/application.rb, line 114 def response_data @response_values.fetch(:data) do raise ProcessingSequenceError, "Location not available until request processed" end end
response_data=(data)
click to toggle source
# File lib/roadforest/interface/application.rb, line 120 def response_data=(data) @response_values[:data] = data end
response_location()
click to toggle source
# File lib/roadforest/interface/application.rb, line 104 def response_location @response_values.fetch(:location) do raise ProcessingSequenceError, "Location not available until request processed" end end
response_location=(location)
click to toggle source
# File lib/roadforest/interface/application.rb, line 110 def response_location=(location) @response_values[:location] = location end
retrieve()
click to toggle source
# File lib/roadforest/interface/application.rb, line 152 def retrieve raise NotImplementedError end
Also aliased as: retreive
update(data)
click to toggle source
# File lib/roadforest/interface/application.rb, line 144 def update(data) raise NotImplementedError end
update_payload()
click to toggle source
# File lib/roadforest/interface/application.rb, line 136 def update_payload nil end
url_for(route_name, params = nil)
click to toggle source
# File lib/roadforest/interface/application.rb, line 29 def url_for(route_name, params = nil) ::RDF::URI.new(Addressable::URI.parse(canonical_host.to_s).join(path_for(route_name, params))) end