Class: Bbs::Post

Inherits:
Object
  • Object
show all
Defined in:
lib/bbiff/bbs_reader.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(no, name, mail, date, body) ⇒ Post

Returns a new instance of Post.



19
20
21
22
23
24
25
# File 'lib/bbiff/bbs_reader.rb', line 19

def initialize(no, name, mail, date, body)
  @no = no.to_i
  @name = name
  @mail = mail
  @date = date
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



17
18
19
# File 'lib/bbiff/bbs_reader.rb', line 17

def body
  @body
end

#dateObject (readonly)

Returns the value of attribute date.



17
18
19
# File 'lib/bbiff/bbs_reader.rb', line 17

def date
  @date
end

#mailObject (readonly)

Returns the value of attribute mail.



17
18
19
# File 'lib/bbiff/bbs_reader.rb', line 17

def mail
  @mail
end

#nameObject (readonly)

Returns the value of attribute name.



17
18
19
# File 'lib/bbiff/bbs_reader.rb', line 17

def name
  @name
end

#noObject (readonly)

Returns the value of attribute no.



17
18
19
# File 'lib/bbiff/bbs_reader.rb', line 17

def no
  @no
end

Class Method Details

.from_s(str) ⇒ Object



12
13
14
# File 'lib/bbiff/bbs_reader.rb', line 12

def from_s(str)
  Post.new(*str.split('<>', 5))
end

Instance Method Details

#to_sObject

削除された時のフィールドの値は、掲示板の設定によるなぁ。def deleted?

@date == '<削除>'

end



32
33
34
# File 'lib/bbiff/bbs_reader.rb', line 32

def to_s
  [no, name, mail, date, body].join('<>')
end