class RedHatSupportLib::Brokers::Article
Public Class Methods
new(connection)
click to toggle source
Calls superclass method
# File lib/brokers/article.rb, line 5 def initialize(connection) super end
Public Instance Methods
get_article(id)
click to toggle source
# File lib/brokers/article.rb, line 16 def get_article(id) #TODO encode input and error handling result = @connection.get("/rs/articles/#{id}", {:accept => :json}) #result.parsed_response end
search(text, limit=10)
click to toggle source
# File lib/brokers/article.rb, line 9 def search(text, limit=10) #TODO encode input and error handling text = URI::encode(text) result = @connection.get("/rs/articles?keyword=#{text}&limit=#{limit}", {:accept => :json}) result['article'] end