Class: Bbs::Post
- Inherits:
-
Object
- Object
- Bbs::Post
- Defined in:
- lib/bbiff/bbs_reader.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#mail ⇒ Object
readonly
Returns the value of attribute mail.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#no ⇒ Object
readonly
Returns the value of attribute no.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(no, name, mail, date, body) ⇒ Post
constructor
A new instance of Post.
-
#to_s ⇒ Object
削除された時のフィールドの値は、掲示板の設定によるなぁ。 def deleted? @date == ‘<削除>’ end.
Constructor Details
#initialize(no, name, mail, date, body) ⇒ Post
Returns a new instance of Post.
21 22 23 24 25 26 27 |
# File 'lib/bbiff/bbs_reader.rb', line 21 def initialize(no, name, mail, date, body) @no = no.to_i @name = name @mail = mail @date = date @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
19 20 21 |
# File 'lib/bbiff/bbs_reader.rb', line 19 def body @body end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
19 20 21 |
# File 'lib/bbiff/bbs_reader.rb', line 19 def date @date end |
#mail ⇒ Object (readonly)
Returns the value of attribute mail.
19 20 21 |
# File 'lib/bbiff/bbs_reader.rb', line 19 def mail @mail end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
19 20 21 |
# File 'lib/bbiff/bbs_reader.rb', line 19 def name @name end |
#no ⇒ Object (readonly)
Returns the value of attribute no.
19 20 21 |
# File 'lib/bbiff/bbs_reader.rb', line 19 def no @no end |
Class Method Details
.from_s(str) ⇒ Object
14 15 16 |
# File 'lib/bbiff/bbs_reader.rb', line 14 def from_s(str) Post.new(*str.split('<>', 5)) end |
Instance Method Details
#to_s ⇒ Object
削除された時のフィールドの値は、掲示板の設定によるなぁ。def deleted?
@date == '<削除>'
end
34 35 36 |
# File 'lib/bbiff/bbs_reader.rb', line 34 def to_s [no, name, mail, date, body].join('<>') end |