api_struct
api_struct copied to clipboard
Can't use multiple clients without prefixes
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: https://github.com/rubygarage/api_struct/issues/13