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/load_friends.rb
2017-07-28 00:33:32 +00:00

20 lines
398 B
Ruby

# frozen_string_literal: true
module Actions
class LoadFriends < Obredux::Action
attr_reader :friends
def initialize(friends)
self.friends = friends
end
private
def friends=(value)
@friends = value.map do |friend|
raise TypeError, "expected friend to be a #{Tox::Friend}" unless friend.is_a? Tox::Friend
friend
end.freeze
end
end
end