Skip to content

Commit

Permalink
tweaked inspect output for Operation
Browse files Browse the repository at this point in the history
  • Loading branch information
mackuba committed Nov 10, 2023
1 parent e9c5f1c commit 3b0f864
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/skyfall/operation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,14 @@ def type
else :unknown
end
end

def inspectable_variables
instance_variables - [:@message]
end

def inspect
vars = inspectable_variables.map { |v| "#{v}=#{instance_variable_get(v).inspect}" }.join(", ")
"#<#{self.class}:0x#{object_id} #{vars}>"
end
end
end

0 comments on commit 3b0f864

Please sign in to comment.