Class: RubyGems

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/gaea/lib/rubygems.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query) ⇒ RubyGems

Create constructor for RubyGems object

query - The query

Examples

RubyGems.new('weather')

Returns nothing



19
20
21
# File 'lib/gaea/lib/rubygems.rb', line 19

def initialize(query)
  @option = { query: { query: query } }
end

Instance Attribute Details

#optionObject (readonly)

Attribute reader



3
4
5
# File 'lib/gaea/lib/rubygems.rb', line 3

def option
  @option
end

Instance Method Details

#gemsObject

List of gems match with query

Examples

rgs = RubyGems.new('weather')
rgs.gems
# =>
  +------+-----------------------------------------------+----------------------------------+-------------+-----------+
  | Name | Info                                          | URL                              | Authors     | Downloads |
  +------+-----------------------------------------------+----------------------------------+-------------+-----------+
  | weer | Display the weather information of your city. | https://github.com/vinhnglx/weer | Vinh Nguyen | 134       |
  +------+-----------------------------------------------+----------------------------------+-------------+-----------+

Returns the table



36
37
38
39
# File 'lib/gaea/lib/rubygems.rb', line 36

def gems
  # TODO: need to get more questions - Apply paginates
  parse_gems
end