Module: LinkedinV2::Url::Response

Defined in:
lib/linkedin_v2/url/response.rb

Constant Summary collapse

TEMPLATE_PATH =
"../templates/endpoints/".freeze

Class Method Summary collapse

Class Method Details

.[](name, **options) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/linkedin_v2/url/response.rb', line 7

def [](name, **options)
  path = TEMPLATE_PATH + "#{name}.erb"
  file = Files::Reader.(path)
  erb = ERB.new(file)

  options.empty? ? erb.result : erb.result_with_hash(options)
end