Sha256: 124140aa241d9ae8e03dc13c7a36120ab5bf074ea17084558654e9d899db4f58
Contents?: true
Size: 1.31 KB
Versions: 1
Compression:
Stored size: 1.31 KB
Contents
require_relative "./configuration" module Jekyll module Airtable class API attr_accessor *Configuration::VALID_OPTIONS_KEYS # Creates a new API def initialize(options={}) options = Airtable.options.merge(options) Configuration::VALID_OPTIONS_KEYS.each do |key| send("#{key}=", options[key]) end end def config conf = {} Configuration::VALID_OPTIONS_KEYS.each do |key| conf[key] = send key end conf end def versioned_base_endpoint_url config[:endpoint] + config[:api_version] + '/' + config[:base_uid] + '/' end def processing_query_params(request_obj, params, params_key) keys = [ :fields, :filter_by_formula, :max_records, :page_size, :sort, :view, :cell_format, :time_zone, :user_locale ] return nil unless keys.include?(params_key) || params[params_key].nil? || params[params_key] == '' key_string = params_key.to_s.split('_').each_with_index.map do |a, i| if i == 0 then a else a.capitalize end end.join request_obj.params[key_string] = params[params_key] end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
jekyll-airtable-0.1.0 | lib/jekyll-airtable/api.rb |