Sha256: 482b29adc56208c754d6f7e241ccd2dea4719d1d7d01bbc4cd0d4e9face7af1b

Contents?: true

Size: 331 Bytes

Versions: 8

Compression:

Stored size: 331 Bytes

Contents

module Rapidash
  module Urlable
    def self.included(base)
      base.extend(ClassMethods)
    end

    module ClassMethods
      def url(url)
        define_method(:initialize) do |*args|
          super(*args)
          @url = "#{base_url}#{url.to_s}"
          @url += "/#{@id}" if @id
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rapidash-0.4.0 lib/rapidash/urlable.rb
rapidash-0.3.1 lib/rapidash/urlable.rb
rapidash-0.3.0 lib/rapidash/urlable.rb
rapidash-0.3.0.beta2 lib/rapidash/urlable.rb
rapidash-0.3.0.beta lib/rapidash/urlable.rb
rapidash-0.2.2 lib/rapidash/urlable.rb
rapidash-0.2.1 lib/rapidash/urlable.rb
rapidash-0.2.0 lib/rapidash/urlable.rb