Class: Henshin::Tag
- Inherits:
-
Object
- Object
- Henshin::Tag
- Defined in:
- lib/henshin/tags.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#posts ⇒ Object
Returns the value of attribute posts.
Instance Method Summary collapse
-
#initialize(name) ⇒ Tag
constructor
A new instance of Tag.
- #inspect ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(name) ⇒ Tag
Returns a new instance of Tag.
6 7 8 9 |
# File 'lib/henshin/tags.rb', line 6 def initialize( name ) @name = name @posts = [] end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/henshin/tags.rb', line 4 def name @name end |
#posts ⇒ Object
Returns the value of attribute posts.
4 5 6 |
# File 'lib/henshin/tags.rb', line 4 def posts @posts end |
Instance Method Details
#inspect ⇒ Object
19 20 21 |
# File 'lib/henshin/tags.rb', line 19 def inspect "#<Tag:#{@name}>" end |
#to_hash ⇒ Object
11 12 13 14 15 16 |
# File 'lib/henshin/tags.rb', line 11 def to_hash hash = { 'name' => @name, 'posts' => @posts.collect {|i| i.to_hash} } end |