Module: LoraRb::Base

Included in:
LoraClient
Defined in:
lib/lora-rb/help.rb,
lib/lora-rb/utility.rb

Overview

It contains generic methods

Instance Method Summary collapse

Instance Method Details

#merge_tags_to_url(url, tags = {}, options = {}) ⇒ Object

Show tips on usage



7
8
9
10
11
12
13
14
15
16
# File 'lib/lora-rb/utility.rb', line 7

def merge_tags_to_url(url, tags={}, options={})
  url = url.dup
  puts "merge_tags_to_url: #{url}" if options[:debug] == :full
  tags.each do |tag, value|
    puts " replace {#{tag}} with #{value}" if options[:debug] == :full
    url.gsub!("{#{tag}}", value.to_s)
  end
  puts "merge_tags_to_url: completed #{url}" if options[:debug] == :full
  url
end