Class: Shinmun::Comment

Inherits:
Object
  • Object
show all
Defined in:
lib/shinmun/comment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#emailObject

Returns the value of attribute email.



5
6
7
# File 'lib/shinmun/comment.rb', line 5

def email
  @email
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/shinmun/comment.rb', line 5

def name
  @name
end

#textObject

Returns the value of attribute text.



5
6
7
# File 'lib/shinmun/comment.rb', line 5

def text
  @text
end

#timeObject

Returns the value of attribute time.



5
6
7
# File 'lib/shinmun/comment.rb', line 5

def time
  @time
end

#websiteObject

Returns the value of attribute website.



5
6
7
# File 'lib/shinmun/comment.rb', line 5

def website
  @website
end