Class: Garage::Meta::RemoteService

Inherits:
Object
  • Object
show all
Includes:
Authorizable, Representer
Defined in:
lib/garage/meta/remote_service.rb

Defined Under Namespace

Classes: Config, ServiceDSL

Instance Attribute Summary collapse

Attributes included from Representer

#params, #partial, #representer_attrs, #selector

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Authorizable

#authorize!, #build_permissions, #effective_permissions

Methods included from Representer

#default_url_options, #handle_definition?, included, #link_path_for, #partial?, #render_hash, #represent!, representers, #resource_class, #to_resource

Instance Attribute Details

#endpointObject

Returns the value of attribute endpoint.



31
32
33
# File 'lib/garage/meta/remote_service.rb', line 31

def endpoint
  @endpoint
end

#nameObject

Returns the value of attribute name.



31
32
33
# File 'lib/garage/meta/remote_service.rb', line 31

def name
  @name
end

#namespaceObject

Returns the value of attribute namespace.



31
32
33
# File 'lib/garage/meta/remote_service.rb', line 31

def namespace
  @namespace
end

Class Method Details

.allObject



14
15
16
# File 'lib/garage/meta/remote_service.rb', line 14

def all
  configuration.services
end

.build_permissions(perms, other, target) ⇒ Object



18
19
20
# File 'lib/garage/meta/remote_service.rb', line 18

def build_permissions(perms, other, target)
  perms.permits! :read
end

.configurationObject



10
11
12
# File 'lib/garage/meta/remote_service.rb', line 10

def configuration
  @config or raise "Garage::Meta::RemoteService.configure must be called in initializer"
end

.configure(&block) ⇒ Object



5
6
7
8
# File 'lib/garage/meta/remote_service.rb', line 5

def configure(&block)
  @config = Config.new
  @config.instance_eval(&block)
end

Instance Method Details

#alternate_endpointsObject



33
34
35
# File 'lib/garage/meta/remote_service.rb', line 33

def alternate_endpoints
  @alternate_endpoints ||= {}
end