Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't use multiple clients without prefixes #14

Open
SteveRedka opened this issue Feb 4, 2020 · 0 comments · May be fixed by #15
Open

Can't use multiple clients without prefixes #14

SteveRedka opened this issue Feb 4, 2020 · 0 comments · May be fixed by #15

Comments

@SteveRedka
Copy link

SteveRedka commented Feb 4, 2020

Currently if you try to use multiple clients in same entity, entity will define methods only from the latest client. As in:

class StubClient < ApiStruct::Client
  def foo
    # do something
  end
end

class AnotherStubClient < ApiStruct::Client
  def bar
    # do something
  end
end

  class StubEntity < ApiStruct::Entity
    client_service StubClient
    client_service AnotherStubClient
  end

It will complain:

> StubEntity.foo
NoMethodError:
  undefined method `foo' for #<AnotherStubClient:0x00000000019128e0>

See also: #13

@SteveRedka SteveRedka linked a pull request Feb 4, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant