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/new_message_putc.rb
2017-07-28 01:47:18 +00:00

19 lines
443 B
Ruby

# frozen_string_literal: true
module Actions
class NewMessagePutc < Obredux::Action
attr_reader :char
def initialize(char)
self.char = char
end
private
def char=(value)
raise TypeError, "expected char to be a #{String}" unless value.is_a? String
raise ArguentError, 'expected char to have length 1' unless value.length == 1
@char = value.frozen? ? value : value.dup.freeze
end
end
end