rubygarage / api_struct

API wrapper builder with response serialization
MIT License
234 stars 21 forks source link

If you don't use prefix for client_service, it ignores ":only" argument #13

Open SteveRedka opened 4 years ago

SteveRedka commented 4 years ago

Let's assume we have an entity working with two APIs. For example:

  class File < ApiStruct::Entity
    client_service CdnClient, only: :show
    client_service RestClient, only: :index

    attr_entity :size, :url, :uuid, :source
  end

If you call File.show it will try to call RestClient.new.show instead of CdnClient.new.show.