Sha256: 25e35292010ef35d150555660197ba33cb0470cac0a45d87f6a826b9de80e3ed

Contents?: true

Size: 537 Bytes

Versions: 2

Compression:

Stored size: 537 Bytes

Contents

module Sentimeta::Client::Data
  extend self
  extend Sentimeta::RestClient
  
  %i(criteria spheres objects catalog).each do |endpoint|
    define_method endpoint do |options={}|
      get(endpoint, options)[endpoint.to_s]
    end
  end

  def attributes options={}
    get(:attributes, options)['values']
  end

  ##
  # Usage:
  #   search text: 'pitt' [, where: 'actors' ]
  def search options={}
    result = get :search, options
    if options.has_key? :where
      result[options[:where]]
    else
      result
    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sentimeta-0.1.2 lib/sentimeta/client/data.rb
sentimeta-0.1.0 lib/sentimeta/client/data.rb