Sha256: dea32979481d48ef316a103585233fc9efebff2c83c8668592b739c9515d1b97

Contents?: true

Size: 360 Bytes

Versions: 39

Compression:

Stored size: 360 Bytes

Contents

class Reparameterize

  def self.call(params, list=false)
    return params.map{|state, param| param }.join(", ") if list

    params.map do |state, param|
      case state
        when :req
          param
        when :rest
          "*#{param}"
        when :opt
          "#{param}=nil"
        else
          param
      end
    end.join(", ")

  end

end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
active_mocker-1.3.2 lib/active_mocker/reparameterize.rb
active_mocker-1.3.1 lib/active_mocker/reparameterize.rb
active_mocker-1.3 lib/active_mocker/reparameterize.rb
active_mocker-1.2.4 lib/active_mocker/reparameterize.rb
active_mocker-1.2.3 lib/active_mocker/reparameterize.rb
active_mocker-1.2 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.11 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.10 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.9 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.8 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.7 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.6 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.5 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.4 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.3 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.2 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre.1 lib/active_mocker/reparameterize.rb
active_mocker-1.2.pre lib/active_mocker/reparameterize.rb
active_mocker-1.1.23 lib/active_mocker/reparameterize.rb
active_mocker-1.1.22 lib/active_mocker/reparameterize.rb