class Assemble::Client::Mock
Public Class Methods
data()
click to toggle source
# File lib/assemble/client.rb, line 89 def self.data @data ||= begin { :tags => {}, } end end
Public Instance Methods
response(options={})
click to toggle source
# File lib/assemble/client.rb, line 97 def response(options={}) url = options[:url] || File.join(@url.to_s, options[:path] || "/") method = (options[:method] || :get).to_s.to_sym status = options[:status] || 200 body = options[:body] headers = { "Content-Type" => "application/json; charset=utf-8" }.merge(options[:headers] || {}) Assemble::Response.new( :status => status, :headers => headers, :body => body, :request => { :method => method, :url => url, } ).raise! end
url_for(path)
click to toggle source
# File lib/assemble/client.rb, line 117 def url_for(path) File.join(@url, path) end