parented_domain.rb
1# frozen_string_literal: true
2
3class ParentedDomain
4 def self.for(jid)
5 config = CONFIG[:parented_domains][Blather::JID.new(jid).domain]
6 config ? new(config) : nil
7 end
8
9 def initialize(config)
10 @config = config
11 end
12
13 def plan_kwargs
14 {
15 plan_name: @config[:plan_name],
16 parent_customer_id: @config[:customer_id]
17 }
18 end
19end