Class: Shinmun::Comment
- Inherits:
-
Object
- Object
- Shinmun::Comment
- Defined in:
- lib/shinmun/comment.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#name ⇒ Object
Returns the value of attribute name.
-
#text ⇒ Object
Returns the value of attribute text.
-
#time ⇒ Object
Returns the value of attribute time.
-
#website ⇒ Object
Returns the value of attribute website.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Comment
constructor
A new instance of Comment.
Constructor Details
#initialize(attributes) ⇒ Comment
Returns a new instance of Comment.
7 8 9 10 11 12 13 |
# File 'lib/shinmun/comment.rb', line 7 def initialize(attributes) for k, v in attributes send("#{k}=", v) if respond_to?("#{k}=") end self.time ||= Time.now end |
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'lib/shinmun/comment.rb', line 5 def email @email end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/shinmun/comment.rb', line 5 def name @name end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/shinmun/comment.rb', line 5 def text @text end |
#time ⇒ Object
Returns the value of attribute time.
5 6 7 |
# File 'lib/shinmun/comment.rb', line 5 def time @time end |
#website ⇒ Object
Returns the value of attribute website.
5 6 7 |
# File 'lib/shinmun/comment.rb', line 5 def website @website end |