Class: IGeTui::LinkTemplate

Inherits:
BaseTemplate show all
Defined in:
lib/igetui/template/link_template.rb

Constant Summary collapse

STRING_ATTRIBUTES =
%i(title text logo logo_url url).freeze
BOOLEAN_ATTRIBUTES =
%i(is_ring is_vibrate is_clearable).freeze

Instance Attribute Summary

Attributes inherited from BaseTemplate

#push_info, #transmission_content, #transmission_type

Instance Method Summary collapse

Methods inherited from BaseTemplate

#get_client_data, #get_push_info, #get_transparent, #set_push_info

Constructor Details

#initializeLinkTemplate

Returns a new instance of LinkTemplate.



8
9
10
11
12
13
# File 'lib/igetui/template/link_template.rb', line 8

def initialize
  super

  STRING_ATTRIBUTES.each { |attr| instance_variable_set("@#{attr}", '') }
  BOOLEAN_ATTRIBUTES.each { |attr| instance_variable_set("@#{attr}", true) }
end

Instance Method Details

#get_action_chainObject



15
16
17
18
19
20
21
22
23
24
25
26
27
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/igetui/template/link_template.rb', line 15

def get_action_chain
  # set actionchain
  action_chain_1 = GtReq::ActionChain.new
  action_chain_1.actionId = 1
  action_chain_1.type = GtReq::ActionChain::Type::Goto
  action_chain_1.next = 10000

  # notification
  action_chain_2 = GtReq::ActionChain.new
  action_chain_2.actionId = 10000
  action_chain_2.type = GtReq::ActionChain::Type::Notification
  action_chain_2.title = title
  action_chain_2.text = text
  action_chain_2. = 
  action_chain_2.logoURL = logo_url
  action_chain_2.ring = is_ring
  action_chain_2.clearable = is_clearable
  action_chain_2.buzz = is_vibrate
  action_chain_2.next = 10010

  # goto
  action_chain_3 = GtReq::ActionChain.new
  action_chain_3.actionId = 10010
  action_chain_3.type = GtReq::ActionChain::Type::Goto
  action_chain_3.next = 10030

  # start web
  action_chain_4 = GtReq::ActionChain.new
  action_chain_4.actionId = 10030
  action_chain_4.type = GtReq::ActionChain::Type::Startweb
  action_chain_4.url = url
  action_chain_4.next = 100

  # end
  action_chain_5 = GtReq::ActionChain.new
  action_chain_5.actionId = 100
  action_chain_5.type = GtReq::ActionChain::Type::Eoa

  [action_chain_1, action_chain_2, action_chain_3, action_chain_4, action_chain_5]
end

#get_push_typeObject



56
57
58
# File 'lib/igetui/template/link_template.rb', line 56

def get_push_type
  "NotifyMsg"
end