Class: InovaDynamicLink::BranchLinkConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/inova_dynamic_link/branch_link_configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attributes) ⇒ BranchLinkConfiguration

Returns a new instance of BranchLinkConfiguration.

Raises:

  • (ArgumentError)


10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 10

def initialize(**attributes)
  attributes = {
    tags: {},
    type: 0,
    duration: 7200,
    extra_data: {},
    **attributes
  }
  raise ArgumentError, "extra_data must be a hash" unless attributes[:extra_data].is_a?(Hash)
  attributes.each do |key, value|
    if respond_to?(:"#{key}=")
      send(:"#{key}=", value)
    else
      raise InovaDynamicLink::UnknownAttributeError.new(key)
    end
  end
end

Instance Attribute Details

#after_click_urlObject

Returns the value of attribute after_click_url.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def after_click_url
  @after_click_url
end

#afterclick_desktop_urlObject

Returns the value of attribute afterclick_desktop_url.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def afterclick_desktop_url
  @afterclick_desktop_url
end

#android_urlObject

Returns the value of attribute android_url.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def android_url
  @android_url
end

#campaignObject

Returns the value of attribute campaign.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def campaign
  @campaign
end

#channelObject

Returns the value of attribute channel.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def channel
  @channel
end

Returns the value of attribute deeplink_path.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def deeplink_path
  @deeplink_path
end

#desktop_urlObject

Returns the value of attribute desktop_url.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def desktop_url
  @desktop_url
end

#desktop_web_onlyObject

Returns the value of attribute desktop_web_only.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def desktop_web_only
  @desktop_web_only
end

#durationObject

Returns the value of attribute duration.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def duration
  @duration
end

#extra_dataObject

Returns the value of attribute extra_data.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def extra_data
  @extra_data
end

#fallback_urlObject

Returns the value of attribute fallback_url.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def fallback_url
  @fallback_url
end

#featureObject

Returns the value of attribute feature.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def feature
  @feature
end

#huawei_urlObject

Returns the value of attribute huawei_url.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def huawei_url
  @huawei_url
end

#ios_urlObject

Returns the value of attribute ios_url.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def ios_url
  @ios_url
end

Returns the value of attribute link_alias.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def link_alias
  @link_alias
end

#mobile_web_onlyObject

Returns the value of attribute mobile_web_only.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def mobile_web_only
  @mobile_web_only
end

#stageObject

Returns the value of attribute stage.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def stage
  @stage
end

#tagsObject

Returns the value of attribute tags.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def tags
  @tags
end

#typeObject

Returns the value of attribute type.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def type
  @type
end

#web_onlyObject

Returns the value of attribute web_only.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def web_only
  @web_only
end

#windows_phone_urlObject

Returns the value of attribute windows_phone_url.



6
7
8
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 6

def windows_phone_url
  @windows_phone_url
end

Instance Method Details

#to_hashObject



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/inova_dynamic_link/branch_link_configuration.rb', line 28

def to_hash
  {
    channel: channel,
    feature: feature,
    stage: stage,
    campaign: campaign,
    tags: tags,
    alias: link_alias,
    type: type,
    duration: duration,
    data: {
      "$fallback_url": fallback_url,
      "$desktop_url": desktop_url,
      "$ios_url": ios_url,
      "$android_url": android_url,
      "$huawei_url": huawei_url,
      "$windows_phone_url": windows_phone_url,
      "$web_only": web_only,
      "$desktop_web_only": desktop_web_only,
      "$mobile_web_only": mobile_web_only,
      "$after_click_url": after_click_url,
      "$afterclick_desktop_url": afterclick_desktop_url,
      "$deeplink_path": deeplink_path,
      **extra_data
    }.compact_blank
  }.compact_blank
end