Sha256: 3f74c3e1d8276eb84775a5a7050c2cb922e773e48c97d170209b5f38fce18be9

Contents?: true

Size: 279 Bytes

Versions: 36

Compression:

Stored size: 279 Bytes

Contents

require "virtus"

module Cobrato
  module Entities
    class Base
      include Virtus.model

      attribute :_links, Array

      def url(action)
        link = _links.detect { |l| l["rel"].to_s == action.to_s } || {}
        link.fetch("href", "")
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
cobrato-client-1.1.7 lib/cobrato/entities/base.rb
cobrato-client-1.1.6 lib/cobrato/entities/base.rb
cobrato-client-1.1.5 lib/cobrato/entities/base.rb
cobrato-client-1.1.4 lib/cobrato/entities/base.rb
cobrato-client-1.1.3 lib/cobrato/entities/base.rb
cobrato-client-1.1.2 lib/cobrato/entities/base.rb
cobrato-client-1.1.1 lib/cobrato/entities/base.rb
cobrato-client-1.1.0 lib/cobrato/entities/base.rb
cobrato-client-1.0.1 lib/cobrato/entities/base.rb
cobrato-client-1.0.0 lib/cobrato/entities/base.rb
cobrato-client-0.27.0 lib/cobrato/entities/base.rb
cobrato-client-0.26.0 lib/cobrato/entities/base.rb
cobrato-client-0.25.0 lib/cobrato/entities/base.rb
cobrato-client-0.24.1 lib/cobrato/entities/base.rb
cobrato-client-0.24.0 lib/cobrato/entities/base.rb
cobrato-client-0.23.0 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta12 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta11 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta10 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta9 lib/cobrato/entities/base.rb