Sha256: afb0dad7964dced1d7cd89ff4da5f5afeea192273bc20276972826ff1c7a2367

Contents?: true

Size: 1.51 KB

Versions: 1

Compression:

Stored size: 1.51 KB

Contents

# KKTIX API Gem

[![Gem Version](https://badge.fury.io/rb/kktix_api.svg)](https://badge.fury.io/rb/kktix_api)
[![Build Status](https://travis-ci.org/twentyfour7/kktix-api.svg?branch=master)](https://travis-ci.org/twentyfour7/kktix-api)

kktix_api is a gem that gets event information of an organization from [KKTIX](https://kktix.com)

## Installation

If you are working on a project, add this to your Gemfile: `gem 'kktix_api'`

For ad hoc installation from command line:

```console
$ gem install kktix_api
```


## Usage

Execute `kktix` of an organization with specific `organization_id`; Otherwise, get latest published events.
```console
$ kktix [org_id]
```

### API

Require kktix_api gem in your code:

```ruby
require 'kktix_api'
```

Get information using domain class `Organization`, you can get attributes like `name`, `uri`, and all the `events` held by the organization.

```ruby
organization = KktixEvent::Organization.find('<organization_id>')
```


List events information from an `Organization`, including `url`, `published`, `title`,  `summary`, `content`, and `author`.

```ruby
organization.events.each do |event|
  puts "#{event.title} (#{event.published})"
  puts event.url
  puts event.content
  puts
end
```

See the following example code for more usage details:

```ruby
oid = 'nthuion'

acts = KktixEvent::KktixApi.events(oid)
puts acts

organization = KktixEvent::Organization.find(oid)
puts organization.name, organization.uri
organization.events.each do |event|
  puts event.title, event.published
end

```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kktix_api-1.0.0 README.md