Class: Assemble::Client::Mock
- Inherits:
-
Object
- Object
- Assemble::Client::Mock
- Defined in:
- lib/assemble/client.rb
Overview
Real
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.data ⇒ Object
89 90 91 92 93 94 95 |
# File 'lib/assemble/client.rb', line 89 def self.data @data ||= begin { :tags => {}, } end end |
Instance Method Details
#response(options = {}) ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/assemble/client.rb', line 97 def response(={}) url = [:url] || File.join(@url.to_s, [:path] || "/") method = ([:method] || :get).to_s.to_sym status = [:status] || 200 body = [:body] headers = { "Content-Type" => "application/json; charset=utf-8" }.merge([:headers] || {}) Assemble::Response.new( :status => status, :headers => headers, :body => body, :request => { :method => method, :url => url, } ).raise! end |
#url_for(path) ⇒ Object
117 118 119 |
# File 'lib/assemble/client.rb', line 117 def url_for(path) File.join(@url, path) end |