class Quandora::Bases

Public Instance Methods

ask(base_id, args = {}) click to toggle source
# File lib/quandora/bases.rb, line 23
def ask(base_id, args = {})
  body = {
    "type": "post-question",
    "data": {
      "title": args["title"],
      "content": args["content"],
      "contentType": args["content_type"] || "markdown"
    }
  }

  resp = @conn.post("kb/#{base_id}/ask") do |req|
    req.body = body.to_json
    req.headers['Content-Type'] = 'application/json'
  end
end
follow(base_id, args = {}) click to toggle source
# File lib/quandora/bases.rb, line 39
def follow(base_id, args = {})
  @api = "kb/#{base_id}/follow"
  index
end
list() click to toggle source
# File lib/quandora/bases.rb, line 2
def list
  @api = "kb/"
  index
end
mlt(base_id, args = {}) click to toggle source
# File lib/quandora/bases.rb, line 17
def mlt(base_id, args = {})
  @api = "kb/#{base_id}/mlt"
  @params.merge!("q": args["q"]) unless args.fetch('q', nil).nil?
  index
end
questions(base_id, args = {}) click to toggle source
# File lib/quandora/bases.rb, line 7
def questions(base_id, args = {})
  @api = "kb/#{base_id}/list"
  @params.merge!("o": args["o"]) unless args.fetch('o', nil).nil?
  @params.merge!("l": args["l"]) unless args.fetch('l', nil).nil?
  @params.merge!("q": args["q"]) unless args.fetch('q', nil).nil?
  @params.merge!("tag": args["tag"]) unless args.fetch('tag', nil).nil?
  @params.merge!("s": args["s"]) unless args.fetch('s', nil).nil?
  index
end
report(kb_id) click to toggle source
# File lib/quandora/bases.rb, line 48
def report(kb_id)
  Quandora::Report.new(@conn, "kb", kb_id)    
end
tag(kb_id) click to toggle source
# File lib/quandora/bases.rb, line 44
def tag(kb_id)
  Quandora::Tag.new(@conn, "kb", kb_id)    
end