Sha256: cd5629b722bdfe6fbe9be666165926e749334a3ca16771333a5efadd203cd716

Contents?: true

Size: 426 Bytes

Versions: 4

Compression:

Stored size: 426 Bytes

Contents

# frozen_string_literal: true

module TokyoApi
  class Base < Vertebrae::Model
    def normalized_base_path
      "#{base_path}/"
    end

    def url_escape(string)
      CGI.escape(string.to_s)
    end

    def required_fields_param(required_fields)
      if required_fields.present?
        "required_fields=#{required_fields.collect { |v| url_escape(v.to_s) }.join(',')}"
      else
        ''
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tokyo_api-1.9.0 lib/tokyo_api/base.rb
tokyo_api-1.8.0 lib/tokyo_api/base.rb
tokyo_api-1.7.0 lib/tokyo_api/base.rb
tokyo_api-1.6.0 lib/tokyo_api/base.rb