Sha256: 5a28db97d622ee635be71aefc005f6e6d3b2e7d2f0b05907c72d987cfbdb794a

Contents?: true

Size: 470 Bytes

Versions: 3

Compression:

Stored size: 470 Bytes

Contents

class Restfulie::Common::Builder::Rules::Link
  # Required
  attr_accessor :href

  # Optional
  attr_accessor :rel, :type
  attr_accessor :hreflang, :title, :length

  # TODO: Inline resource and collection support
  def initialize(options = {})
    options = { :rel => options } unless options.kind_of?(Hash)
    options.each do |k, i|
      self.send("#{k}=".to_sym, i)
    end
  end

  def rel=(value)
    @rel = value.kind_of?(String) ? value : value.to_s
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
restfulie-0.7.2 lib/restfulie/common/builder/rules/link.rb
restfulie-0.7.1 lib/restfulie/common/builder/rules/link.rb
restfulie-0.7.0 lib/restfulie/common/builder/rules/link.rb