class LinkedinV2::Url::Builder

Public Class Methods

call(key, **options) click to toggle source
# File lib/linkedin_v2/url/builder.rb, line 6
def self.call(key, **options)
  new.(key, options)
end

Public Instance Methods

call(key, **options) click to toggle source

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

# 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

Private Instance Methods

company(identifier:, projection: nil) click to toggle source

'identifier' - organization id - required 'projection' - query to get specific attributes - optional

# File lib/linkedin_v2/url/builder.rb, line 37
def company(identifier:, projection: nil)
  Response[__method__, { identifier: identifier, projection: projection }]
end
me(projection: nil) click to toggle source

'projection' - query to get specific attributes - optional

# File lib/linkedin_v2/url/builder.rb, line 51
def me(projection: nil)
  Response[__method__, { projection: projection }]
end
organizations(projection: nil, start: nil, count: nil) click to toggle source

'projection' - query to get specific attributes - optional

# File lib/linkedin_v2/url/builder.rb, line 31
def organizations(projection: nil, start: nil, count: nil)
  Response[__method__, { projection: projection, start: start, count: count }]
end
shares() click to toggle source
# File lib/linkedin_v2/url/builder.rb, line 22
def shares
  Response[__method__]
end
ugc_post() click to toggle source
# File lib/linkedin_v2/url/builder.rb, line 26
def ugc_post
  Response[__method__]
end
upload_image() click to toggle source
# File lib/linkedin_v2/url/builder.rb, line 46
def upload_image
  Response[__method__]
end