Class: Refinery::WordPress::Tag
- Inherits:
-
Object
- Object
- Refinery::WordPress::Tag
- Defined in:
- lib/wordpress/tag.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(text) ⇒ Tag
constructor
A new instance of Tag.
- #to_refinery ⇒ Object
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
#name ⇒ Object
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_refinery ⇒ Object
14 15 16 |
# File 'lib/wordpress/tag.rb', line 14 def to_refinery ::ActsAsTaggableOn::Tag.find_or_create_by_name(name) end |