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

21 lines
398 B
Ruby
Raw Normal View History

2017-07-27 20:33:32 -04:00
# 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