Module: Shaf::UriHelper

Extended by:
UriHelperMethods
Includes:
UriHelperMethods
Included in:
Profile, Serializer, Spec::Base
Defined in:
lib/shaf/extensions/resource_uris.rb

Class Method Summary collapse

Methods included from UriHelperMethods

add_path_helpers, eval_method, path_helpers, path_helpers, path_helpers_for, register, remove_all

Class Method Details

.base_uriObject



86
87
88
89
90
91
92
93
# File 'lib/shaf/extensions/resource_uris.rb', line 86

def self.base_uri
  return Settings.base_uri if Settings.base_uri

  protocol = Settings.protocol || 'http'
  host = Settings.hostname || 'localhost'
  port = Settings.port ? ":#{Settings.port}" : ""
  "#{protocol}://#{host}#{port}"
end

.included(mod) ⇒ Object



82
83
84
# File 'lib/shaf/extensions/resource_uris.rb', line 82

def self.included(mod)
  mod.extend self
end