Sha256: b12b0376a3ab6227343cadba4743a45ba06a088d0f6fff2ed3524366590ede49

Contents?: true

Size: 1.41 KB

Versions: 5

Compression:

Stored size: 1.41 KB

Contents

module Restfulie
  module Common
    module Representation
      module Atom
        class Link < XML    
          def initialize(options_or_obj)
            if options_or_obj.kind_of?(Hash)
              @doc = Nokogiri::XML::Document.new()
              options_or_obj = create_element("link", options_or_obj)
            end
            super(options_or_obj)
          end
          
          def href
            @doc["href"]
          end
          
          def href=(value)
            @doc["href"] = value
          end
          
          def rel
            @doc["rel"]
          end
          
          def rel=(value)
            @doc["rel"] = value
          end
      
          if method_defined?(:type)
            alias_method :__type__, :type
          end
          def type
            @doc["type"]
          end
          
          def type=(value)
            @doc["type"] = value
          end
      
          def hreflang
            @doc["hreflang"]
          end
          
          def hreflang=(value)
            @doc["hreflang"] = value
          end
      
          def title
            @doc["title"]
          end
          
          def title=(value)
            @doc["title"] = value
          end
          
          def length
            @doc["length"]
          end
          
          def length=(value)
            @doc["length"] = value
          end
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
restfulie-1.0.0.beta1 lib/restfulie/common/representation/atom/link.rb
restfulie-0.1.0.beta1 lib/restfulie/common/representation/atom/link.rb
restfulie-0.9.3 lib/restfulie/common/representation/atom/link.rb
restfulie-0.9.1 lib/restfulie/common/representation/atom/link.rb
restfulie-0.8.1 lib/restfulie/common/representation/atom/link.rb