Class: Gnomika::Subcategory

Inherits:
Object
  • Object
show all
Defined in:
lib/gnomikologikon/category.rb

Overview

A quote subcategory. Has a name and a URL to the quotes page.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(subcategory_name, subcategory_url) ⇒ Subcategory

Returns a new instance of Subcategory.

Parameters:

  • subcategory_name

    Subcategory name

  • subcategory_url

    URL containing the quotes of this subcategory



25
26
27
28
# File 'lib/gnomikologikon/category.rb', line 25

def initialize(subcategory_name, subcategory_url)
  @name = subcategory_name
  @url = subcategory_url
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



20
21
22
# File 'lib/gnomikologikon/category.rb', line 20

def name
  @name
end

#quotesObject (readonly)

Returns the value of attribute quotes.



20
21
22
# File 'lib/gnomikologikon/category.rb', line 20

def quotes
  @quotes
end

#urlObject (readonly)

Returns the value of attribute url.



20
21
22
# File 'lib/gnomikologikon/category.rb', line 20

def url
  @url
end

Instance Method Details

#==(other) ⇒ Object



30
31
32
# File 'lib/gnomikologikon/category.rb', line 30

def ==(other)
  self.name == other.name
end