Sha256: 21a15a5c53727e96e98bc7be0a456c703e3e39e328a1277dd06e125d1ac7fb3f

Contents?: true

Size: 420 Bytes

Versions: 23

Compression:

Stored size: 420 Bytes

Contents

#
#  Link model.
#
module Restful
  module ApiModel
    class Link < Attribute
      attr_accessor :base, :path
      
      def initialize(name, base, path, extended_type)        
        self.base = base
        self.path = path
        super(name, self.full_url, extended_type)
        self.type = :link
      end
      
      def full_url
        base.blank? ? path : "#{ base }#{ path }"
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 4 rubygems

Version Path
benjaminkrause-restful-0.2.8 lib/restful/apimodel/link.rb
moviepilot-restful-0.2.18 lib/restful/apimodel/link.rb
moviepilot-restful-0.2.19 lib/restful/apimodel/link.rb
moviepilot-restful-0.2.20 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.1 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.10 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.11 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.12 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.13 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.14 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.15 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.16 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.17 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.18 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.2 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.3 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.4 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.5 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.6 lib/restful/apimodel/link.rb
purzelrakete-restful-0.2.7 lib/restful/apimodel/link.rb