module Multicolor::REST::Endpoints::Metadata

Public Instance Methods

count() click to toggle source
# File lib/multicolor/rest/endpoints/metadata.rb, line 32
def count
  get(:count)
end
count_collection_colors(options) click to toggle source

{

count_colors: ["122,233,433", "343,433,333"]
filepaths: ["/one/image", "/another/image"]
metadata: {
  ...
}

}

# File lib/multicolor/rest/endpoints/metadata.rb, line 12
def count_collection_colors(options)
  keys = [:count_colors, :weights, :filepaths]
  formatted_options = extract_and_format_options(options, keys)
  get(:count_collection_colors, formatted_options)
end
count_metadata(options) click to toggle source
# File lib/multicolor/rest/endpoints/metadata.rb, line 18
def count_metadata(options)
  keys = [:colors, :count_metadata, :weights, :filepaths]
  formatted_options = extract_and_format_options(options, keys)
  get(:count_metadata, formatted_options)
end
get_return_metadata() click to toggle source
# File lib/multicolor/rest/endpoints/metadata.rb, line 28
def get_return_metadata
  get(:get_return_metadata)
end
get_search_metadata() click to toggle source
# File lib/multicolor/rest/endpoints/metadata.rb, line 24
def get_search_metadata
  get(:get_search_metadata)
end
list(options = {}) click to toggle source
# File lib/multicolor/rest/endpoints/metadata.rb, line 36
def list(options = {})
  get(:list, options)
end
ping() click to toggle source
# File lib/multicolor/rest/endpoints/metadata.rb, line 40
def ping
  get(:ping)
end

Private Instance Methods

extract_and_format_options(options, keys) click to toggle source
# File lib/multicolor/rest/endpoints/metadata.rb, line 46
def extract_and_format_options(options, keys)
  payload = Multicolor::Util.payload_builder(options.delete(:colors))
  options = Multicolor::Util::modify_options_for_keys(options, keys)
  options.merge(payload)
end