Sha256: 80534a84f43ff63fcf1fc1fdcab06cac887faafa799e4c44c62b1b02b257337a

Contents?: true

Size: 670 Bytes

Versions: 3

Compression:

Stored size: 670 Bytes

Contents

module Restfulie
  module Common
    module Converter
      module Xml
        class Links
          def initialize(links)
            links = [links] unless links.kind_of? Array
            links = [] unless links
            @links = links.map do |l|
              link = Restfulie::Common::Converter::Xml::Link.new(l)
              link.instance_eval { self.class.send :include, ::Restfulie::Client::HTTP::LinkRequestBuilder }
              link
            end
          end
          
          def method_missing(sym, *args)
            @links.find do |link|
              link.rel == sym.to_s
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
restfulie-0.9.3 lib/restfulie/common/converter/xml/links.rb
restfulie-0.9.1 lib/restfulie/common/converter/xml/links.rb
restfulie-0.8.1 lib/restfulie/common/converter/xml/links.rb