Class: Crispy::CrispyReceivedMessage
- Inherits:
-
Object
- Object
- Crispy::CrispyReceivedMessage
- Defined in:
- lib/crispy/crispy_received_message.rb
Constant Summary collapse
- DELEGATABLE_METHODS =
[:method_name, :arguments, :attached_block]
- CLASS_NAME =
self.name
- PP_HEADER =
"#<#{CLASS_NAME}["
- PP_CYCLE =
"#{PP_HEADER}...]>"
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(method_name, *arguments, &attached_block) ⇒ CrispyReceivedMessage
constructor
A new instance of CrispyReceivedMessage.
- #pretty_print(pp) ⇒ Object
- #pretty_print_cycle(pp) ⇒ Object
- #to_s ⇒ Object (also: #inspect)
Constructor Details
#initialize(method_name, *arguments, &attached_block) ⇒ CrispyReceivedMessage
Returns a new instance of CrispyReceivedMessage.
12 13 14 15 16 |
# File 'lib/crispy/crispy_received_message.rb', line 12 def initialize method_name, *arguments, &attached_block @method_name = method_name @arguments = arguments @attached_block = attached_block end |
Instance Method Details
#==(other) ⇒ Object
18 19 20 21 22 |
# File 'lib/crispy/crispy_received_message.rb', line 18 def == other @method_name == other.method_name && @arguments == other.arguments # && # @attached_block == other.attached_block end |
#pretty_print(pp) ⇒ Object
34 35 36 37 38 39 40 41 42 43 |
# File 'lib/crispy/crispy_received_message.rb', line 34 def pretty_print pp pp.group 2, PP_HEADER do pp.pp @method_name pp.text ','.freeze pp.breakable pp.text '*'.freeze pp.pp @arguments pp.text ']>'.freeze end end |
#pretty_print_cycle(pp) ⇒ Object
47 48 49 |
# File 'lib/crispy/crispy_received_message.rb', line 47 def pretty_print_cycle pp pp.text PP_CYCLE end |
#to_s ⇒ Object Also known as: inspect
26 27 28 |
# File 'lib/crispy/crispy_received_message.rb', line 26 def to_s "#<#{CLASS_NAME}[#{@method_name.inspect}, *#{@arguments.inspect}]>" end |