Class: QDB::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/cinch/plugins/qdb/base.rb

Direct Known Subclasses

Bash, MIT, QdbUS, Shakesoda

Defined Under Namespace

Classes: Quote

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base



16
17
# File 'lib/cinch/plugins/qdb/base.rb', line 16

def initialize
end

Instance Attribute Details

#id_path_templateObject (readonly)

Returns the value of attribute id_path_template



12
13
14
# File 'lib/cinch/plugins/qdb/base.rb', line 12

def id_path_template
  @id_path_template
end

#latest_pathObject (readonly)

Returns the value of attribute latest_path



12
13
14
# File 'lib/cinch/plugins/qdb/base.rb', line 12

def latest_path
  @latest_path
end

#nameObject (readonly)

Returns the value of attribute name



12
13
14
# File 'lib/cinch/plugins/qdb/base.rb', line 12

def name
  @name
end

#random_pathObject (readonly)

Returns the value of attribute random_path



12
13
14
# File 'lib/cinch/plugins/qdb/base.rb', line 12

def random_path
  @random_path
end

#shortnameObject (readonly)

Returns the value of attribute shortname



12
13
14
# File 'lib/cinch/plugins/qdb/base.rb', line 12

def shortname
  @shortname
end

#urlObject (readonly)

Returns the value of attribute url



12
13
14
# File 'lib/cinch/plugins/qdb/base.rb', line 12

def url
  @url
end

Instance Method Details

#by_id(id) ⇒ Object



19
# File 'lib/cinch/plugins/qdb/base.rb', line 19

def by_id(id); raise "#{__method__} must be overridden."; end

#latestObject

This can be overridden if needed.



25
26
27
# File 'lib/cinch/plugins/qdb/base.rb', line 25

def latest # This can be overridden if needed.
  self.by_id(@url + @latest_path)
end

#randomObject

This can be overridden if needed.



21
22
23
# File 'lib/cinch/plugins/qdb/base.rb', line 21

def random # This can be overridden if needed.
  self.by_id(@url + @random_path)
end