Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/contact-data.rb

Instance Method Summary collapse

Instance Method Details

#to_options(base, text = nil) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/contact-data.rb', line 11

def to_options(base, text = nil)
  o = { base: base }

  [:verbose, :url_base, :api_base, :format, :noformat].each { |k| o[k] = delete(k) if key?(k) }

  o[:payload] = { text: text } if text
  o[:params] = self unless empty?
  o
end