# How to pass more than one params in bind method monads

**URL:** https://discourse.dry-rb.org/t/how-to-pass-more-than-one-params-in-bind-method-monads/1573
**Category:** Support
**Created:** [December 16, 2022, 3:52pm UTC](https://discourse.dry-rb.org/t/how-to-pass-more-than-one-params-in-bind-method-monads/1573 "2022-12-16T15:52:39Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![wichru](https://avatars.discourse-cdn.com/v4/letter/w/a4c791/32.png) [@wichru](https://discourse.dry-rb.org/u/wichru)
#### Post date: [December 16, 2022, 3:52pm UTC](https://discourse.dry-rb.org/t/how-to-pass-more-than-one-params-in-bind-method-monads/1573/1 "2022-12-16T15:52:39Z")

</div>

I’m just wondering, is something changed lately or I mixed up something. Let’s assume I’ve got below class:

```auto
require 'dry-monads'
require 'dry/monads/all'

module Test
  class MonadsClass
    include Dry::Monads

    def initialize(signees)
      @signees = signees
    end

    def call
      Success(signees)
        .bind(method(:fetch_template))
        .bind(method(:envelope_from_template))
    end

    attr_reader :signees

    private

    def fetch_template(signees)
      key = "template_#{signees.size}".to_sym
      template_id = Rails.application.credentials.some_api.fetch(key)

      Success(template_id: template_id, key: key)
    end

    def envelope_from_template(template_id:, key:)
      response = some_api.copy_from_template(template_id, key)

      response.failure? ? Failure(response.failure) : Success(response.value!)
    end
  end
end

```

Why on earth I’m getting strange error of:

````auto
     Failure/Error:
           def envelope_from_template(template_id:, key:)
             response = some_api.copy_from_template(template_id)

             response.failure? ? Failure(response.failure) : Success(response.value!)
           end

     ArgumentError:
       wrong number of arguments (given 1, expected 0; required keywords: template_id, key)```

It's not allowed anymore to passed more argument than the first `bind` one?
````

---

<div class="post-metadata">

### Author: ![stoivo](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/stoivo/32/827_2.png) [@stoivo](https://discourse.dry-rb.org/u/stoivo)
#### Post date: [December 30, 2022, 9:11am UTC](https://discourse.dry-rb.org/t/how-to-pass-more-than-one-params-in-bind-method-monads/1573/2 "2022-12-30T09:11:34Z")

</div>

I test tested a bit and this used to work in ruby 2.x, in ruby 3 when we got a bigger change to ruby keywords then it stoped working. Does that match with your experience?  
This might be worth getting one of the core maintainer attentsion.

And a small note. It is super helpfull to have code examples but if you want to take it one step further you should include a script which is ready to run to demonstrate the issue. I alterert your example to

```auto
require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'dry-monads', '~> 1.6.0'
end

require 'dry-monads'
require 'dry/monads/all'

module Test
  class MonadsClass
    include Dry::Monads

    def initialize(signees)
      @signees = signees
    end

    def call
      Success(signees)
        .bind(method(:fetch_template))
        .bind(method(:envelope_from_template))
    end

    attr_reader :signees

    private

    def fetch_template(signees)
      key = "template_#{signees.size}".to_sym
      template_id = "Rails.application.credentials.some_api.fetch(#{key})"

      Success(template_id: template_id, key: key)
    end

    def envelope_from_template(template_id:, key:)
    # def envelope_from_template(options) # in ruby 3 you will receive them as options
      response = "some_api.copy_from_template(#{template_id}, #{key})"

      rand > 0.5 ? Failure(response) : Success(response)
    end
  end
end

pp Test::MonadsClass.new("lol").call

```
