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-0.23.0.beta8 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta7 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta6 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta5 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta4 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta3 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta2 lib/cobrato/entities/base.rb
cobrato-client-0.23.0.beta1 lib/cobrato/entities/base.rb
cobrato-client-0.22.0 lib/cobrato/entities/base.rb
cobrato-client-0.21.0 lib/cobrato/entities/base.rb
cobrato-client-0.20.0 lib/cobrato/entities/base.rb
cobrato-client-0.19.0 lib/cobrato/entities/base.rb
cobrato-client-0.18.0 lib/cobrato/entities/base.rb
cobrato-client-0.17.0 lib/cobrato/entities/base.rb
cobrato-client-0.16.0 lib/cobrato/entities/base.rb
cobrato-client-0.15.0 lib/cobrato/entities/base.rb