Archived
1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
cli-old/lib/actions/change_friend_status_message.rb

25 lines
653 B
Ruby
Raw Normal View History

2017-07-27 21:47:18 -04:00
# frozen_string_literal: true
module Actions
class ChangeFriendStatusMessage < Obredux::Action
attr_reader :friend, :new_status_message
def initialize(friend, new_status_message)
self.friend = friend
self.new_status_message = new_status_message
end
private
def friend=(value)
raise TypeError, "expected friend to be a #{Tox::Friend}" unless value.is_a? Tox::Friend
@friend = value
end
def new_status_message=(value)
raise TypeError, "expected status message to be a #{String}" unless value.is_a? String
@new_status_message = value.frozen? ? value : value.dup.freeze
end
end
end