lib/ruby-lokalise-api/resources/base.rb
def object_from(response, params)
          model_class = name.base_class_name
          data_key_plural = data_key_for model_class: model_class, plural: true
          # Preserve the initial path to allow chaining
          response['path'] = params.delete(:_initial_path) if params.key?(:_initial_path)

          if response['content'].key?(data_key_plural)
            produce_collection model_class, response, params
          else
            produce_resource model_class, response
          end
        end
# Instantiates a new resource or collection based on the given response
Instantiates a new resource or collection based on the given response
Instantiates a new resource or collection based on the given response
def object_from(response, params)
          model_class = name.base_class_name
          data_key_plural = data_key_for model_class: model_class, plural: true
          response['path'] = params.delete(:_initial_path) if params.key?(:_initial_path)
          if response['content'].key?(data_key_plural)
            produce_collection model_class, response, params
          else
            produce_resource model_class, response
          end
        end
def object_from ( response , params ) model_class = name . base_class_name data_key_plural = data_key_for model_class : model_class , plural : true response [ 'path' ] = params . delete ( :_initial_path ) if params . key? ( :_initial_path ) if response [ 'content' ] . key? ( data_key_plural ) produce_collection model_class , response , params else produce_resource model_class , response end end
Instantiates a new resource or collection based on the given response
Instantiates a new resource or collection based on the given response
# Preserve the initial path to allow chaining
response
params