class Loquor::ApiCall::Show
Public Class Methods
new(klass, id)
click to toggle source
Calls superclass method
Loquor::ApiCall::new
# File lib/loquor/api_calls/show.rb, line 4 def initialize(klass, id) super(klass) @id = id end
Public Instance Methods
execute()
click to toggle source
# File lib/loquor/api_calls/show.rb, line 9 def execute return nil unless @id begin get_data rescue RestClient::ResourceNotFound if Loquor.config.retry_404s sleep(1) get_data else raise end end end
Private Instance Methods
get_data()
click to toggle source
# File lib/loquor/api_calls/show.rb, line 24 def get_data options = {cache: klass.cache} klass.new Loquor.get("#{klass.path}/#{@id}", options) end