Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

answers-ruby-client

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

answers-ruby-client

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Build Status Code Climate Coverage Status

answers-ruby-client

Low level Ruby access to the Answers Platform API

Installation

gem 'answers-ruby-client'
gem install answers-ruby-client

Usage

Synopsis

require 'answers'

Answers.init

questions = Answers::Question.all
questions.each do |question|
  p question.id
  p question.text
end

answers = Answers::Answer.all
answers.each do |answer|
  p answer.id
  p answer.text
  p answer.question_id
  q = Answers::Question.find(question.id)
  p q.text
end

# write API (requires authentication)

Answers.init({
  user_email: 'person@email.tld',
  user_token: '1234567890qwertyuiop'
})

question = Answers::Question.new
question.text = 'Is this a question?'
question.save

answer = Answers::Answer.new
answer.text = 'Yes, this is a question.'
answer.question_id = question.id
answer.save

CRUD

Create
Answers::Question.new(text: 'hello').save
Answers::Answer.new(text: 'hello').save
Read
Answers.Question.find(1)
Answers.Answer.find(1)
Update
a = Answers::Question.find(1)
a.text = 'new_text'
a.save
Delete
a = Answers::Question.find(1)
a.text = 'new_text'
a.delete

Question attributes

  • id (Integer)
  • created_at (String)
  • updated_at (String)
  • text (String) - the text of the question
  • in_language (String) - the language of the question
  • need_to_know (String)

Answer

  • id (Integer)
  • created_at (String)
  • updated_at (String)
  • text (String) - the text of the answer
  • in_language (String) - the language of the answer
  • question_id (Integer) - the id of the question that the Answer belongs to

Contributing

  1. Fork it ( https://github.com/18F/answers-ruby-client/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

License

Public Domain. See LICENSE.txt.

FAQs

Package last updated on 28 Jul 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc