Class: Refinery::WordPress::Category

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Category

Returns a new instance of Category.



6
7
8
# File 'lib/wordpress/category.rb', line 6

def initialize(text)
  @name = text
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/wordpress/category.rb', line 4

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



10
11
12
# File 'lib/wordpress/category.rb', line 10

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

#to_refineryObject



14
15
16
# File 'lib/wordpress/category.rb', line 14

def to_refinery
  BlogCategory.find_or_create_by_title(name)
end