class Mocha::PrettyParameters
Public Class Methods
new(params)
click to toggle source
# File lib/mocha/pretty_parameters.rb, line 7 def initialize(params) @params = params @params_string = params.mocha_inspect end
Public Instance Methods
pretty()
click to toggle source
# File lib/mocha/pretty_parameters.rb, line 12 def pretty remove_outer_array_braces! remove_outer_hash_braces! @params_string end
remove_outer_array_braces!()
click to toggle source
# File lib/mocha/pretty_parameters.rb, line 18 def remove_outer_array_braces! @params_string = @params_string.gsub(/^\[|\]$/, '') end
remove_outer_hash_braces!()
click to toggle source
# File lib/mocha/pretty_parameters.rb, line 22 def remove_outer_hash_braces! @params_string = @params_string.gsub(/^\{|\}$/, '') if @params.length == 1 end