Module: Pexels

Defined in:
lib/pexels.rb,
lib/pexels/client.rb,
lib/pexels/errors.rb,
lib/pexels/version.rb,
lib/pexels/photo_set.rb,
lib/pexels/video_set.rb,
lib/pexels/collection.rb,
lib/pexels/client/photos.rb,
lib/pexels/client/videos.rb,
lib/pexels/client/request.rb,
lib/pexels/collection_set.rb,
lib/pexels/client/response.rb,
lib/pexels/paginated_response.rb,
lib/pexels/collection_media_set.rb,
lib/pexels/client/search_filters.rb

Defined Under Namespace

Classes: APIError, Client, Collection, CollectionMediaSet, CollectionSet, MalformedAPIResponseError, PaginatedResponse, Photo, PhotoSet, User, Video, VideoSet

Constant Summary collapse

VERSION =
'0.4.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_base_urlObject (readonly)

Returns the value of attribute api_base_url.


6
7
8
# File 'lib/pexels.rb', line 6

def api_base_url
  @api_base_url
end

.api_versionObject (readonly)

Returns the value of attribute api_version.


6
7
8
# File 'lib/pexels.rb', line 6

def api_version
  @api_version
end

Class Method Details

.local_headersObject

Local headers can be defined inside a `.headers` file at the project root, with the following format:

header1=value header2=value etc.


15
16
17
18
19
20
21
# File 'lib/pexels.rb', line 15

def local_headers
  @local_headers ||= if File.exist?('.headers')
      File.read('.headers').split.to_h { |header| header.split('=') }
    else
      {}
    end
end