Class: LinkedinV2::Url::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/linkedin_v2/url/builder.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(key, **options) ⇒ Object



6
7
8
# File 'lib/linkedin_v2/url/builder.rb', line 6

def self.call(key, **options)
  new.(key, options)
end

Instance Method Details

#call(key, **options) ⇒ Object

key -> Symbol object - Name of method to get endpoint Files::Reader. options -> Hash object - Each method needs a specific parameter



12
13
14
15
16
17
18
# File 'lib/linkedin_v2/url/builder.rb', line 12

def call(key, **options)
  path = options.empty? ? send(key) : send(key, Helpers::Url.escape(**options))

  path.strip
rescue NoMethodError, ArgumentError => exception
  raise InvalidEndpointError.new("endpoint not found", details: exception.message)
end