Class: Refinery::WordPress::Tag

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Tag

Returns a new instance of Tag.



6
7
8
# File 'lib/wordpress/tag.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/tag.rb', line 4

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



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

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

#to_refineryObject



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

def to_refinery
  ::ActsAsTaggableOn::Tag.find_or_create_by_name(name)
end