Method: LiffService#initialize

Defined in:
lib/kamiliff/services/liff_service.rb

#initialize(options) ⇒ LiffService

Returns a new instance of LiffService.



17
18
19
20
21
22
23
24
25
# File 'lib/kamiliff/services/liff_service.rb', line 17

def initialize(options)
  self.path = options[:path] || "/"
  self.size = options[:liff_size] || :compact
  self.size = size.to_s.upcase
  raise "liff_size should be compact, tall or full." unless size.in? %w[COMPACT TALL FULL]
  self.url = ENV["LIFF_#{size}"]
  raise "LIFF_#{size} should be in the env variables" if url.blank?
  self.id = url[(url.rindex('/')+1)..-1]
end