Sha256: 42b40ccceac4c94baa460740bd1a9c91a712b60021dd98fe13fa942f5ddaf617

Contents?: true

Size: 989 Bytes

Versions: 20

Compression:

Stored size: 989 Bytes

Contents

# Sentimeta

## Installation

Add this line to your application's Gemfile:

    gem 'sentimeta'

And then execute:

    $ bundle

## Usage

```ruby
Sentimeta.env   = :staging # :production is default
Sentimeta.lang  = :en # default is I18n.locale if defined

# client can be used directly (fetch criteria, spheres, catalog & objects)
spheres = Sentimeta::Client.spheres
Sentimeta.sphere = spheres.first['name'] # pick a specific sphere

# or via subclassing Sentimeta::Model
class Criterion < Sentimeta::Model
  endpoint :criteria # send requests to /api/v1/#{Sentimeta.sphere}/criteria
  attr_accessor :name, :label, :subcriteria

  def self.all
    fetch subcriteria: true
  end

  def self.leafs
    all.flat_map do |root|
      root.subcriteria.map { |sub| new sub }
    end
  end
end

criteria = Criterion.leafs # an array of Criterion class instances

# to fetch raw data
presets = Sentimeta::Client.fetch :infotext, {subcriteria: true, design: "std", param: "main", lang: "en"}
```

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
sentimeta-0.1.22 README.md
sentimeta-0.1.21 README.md
sentimeta-0.1.20 README.md
sentimeta-0.1.10 README.md
sentimeta-0.1.9 README.md
sentimeta-0.1.8 README.md
sentimeta-0.1.7 README.md
sentimeta-0.1.6 README.md
sentimeta-0.1.5 README.md
sentimeta-0.1.4 README.md
sentimeta-0.1.3 README.md
sentimeta-0.1.2 README.md
sentimeta-0.1.0 README.md
sentimeta-0.0.8 README.md
sentimeta-0.0.7 README.md
sentimeta-0.0.6 README.md
sentimeta-0.0.5 README.md
sentimeta-0.0.4 README.md
sentimeta-0.0.3 README.md
sentimeta-0.0.2 README.md