Class: S2D::Message
- Inherits:
-
Object
- Object
- S2D::Message
- Defined in:
- lib/s2d/message.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#subject ⇒ Object
Returns the value of attribute subject.
Instance Method Summary collapse
-
#initialize(subject = "from #{%x[hostname].chomp}:", body = nil) ⇒ Message
constructor
A new instance of Message.
- #invalid? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(subject = "from #{%x[hostname].chomp}:", body = nil) ⇒ Message
Returns a new instance of Message.
5 6 7 |
# File 'lib/s2d/message.rb', line 5 def initialize(subject = "from #{%x[hostname].chomp}:", body = nil) @subject, @body = subject, body end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
3 4 5 |
# File 'lib/s2d/message.rb', line 3 def body @body end |
#subject ⇒ Object
Returns the value of attribute subject.
3 4 5 |
# File 'lib/s2d/message.rb', line 3 def subject @subject end |
Instance Method Details
#invalid? ⇒ Boolean
13 14 15 |
# File 'lib/s2d/message.rb', line 13 def invalid? @subject.nil? || @body.nil? || @subject.empty? || @body.empty? end |
#valid? ⇒ Boolean
9 10 11 |
# File 'lib/s2d/message.rb', line 9 def valid? valid? end |