Class: Interfacets::Client::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/interfacets/client/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#mount_point ⇒ Object

Returns the value of attribute mount_point.



6
7
8
# File 'lib/interfacets/client/config.rb', line 6

def mount_point
  @mount_point
end

#root_url ⇒ Object

Returns the value of attribute root_url.



6
7
8
# File 'lib/interfacets/client/config.rb', line 6

def root_url
  @root_url
end

Instance Method Details

#url_for(path:) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/interfacets/client/config.rb', line 11

def url_for(path:)
  [
    root_url,
    mount_point,
    path,
  ]
    .map { _1.sub(%r{/$}, "").sub(%r{^/}, "") }
    .join("/")
end