Skip to content

Commit

Permalink
added 'number' method to incoming and outgoing messages, so they can
Browse files Browse the repository at this point in the history
both be logged with the same code. quack!
  • Loading branch information
adammck committed Jan 22, 2009
1 parent 17f5e19 commit c0a3725
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/rubygsm/msg/incoming.rb
Expand Up @@ -21,8 +21,11 @@ def initialize(device, sender, sent, text)
@received = Time.now
end

def to_a
[@device, @sender, @sent, @text]
# Returns the sender of this message,
# so incoming and outgoing messages
# can be logged in the same way.
def number
sender
end
end
end
7 changes: 7 additions & 0 deletions lib/rubygsm/msg/outgoing.rb
Expand Up @@ -26,5 +26,12 @@ def send!
# more modifications
freeze
end

# Returns the recipient of this message,
# so incoming and outgoing messages
# can be logged in the same way.
def number
recipient
end
end
end

0 comments on commit c0a3725

Please sign in to comment.