Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
igetui-ruby
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
igetui-ruby
Commits
80d493c1
Commit
80d493c1
authored
Aug 22, 2014
by
Victor Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构模板的初始化方法
parent
9f66c58e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
53 deletions
+31
-53
lib/igetui/template/base_template.rb
+2
-0
lib/igetui/template/link_template.rb
+7
-11
lib/igetui/template/notification_template.rb
+7
-11
lib/igetui/template/noty_pop_load_template.rb
+15
-29
lib/igetui/template/transmission_template.rb
+0
-2
No files found.
lib/igetui/template/base_template.rb
View file @
80d493c1
...
...
@@ -3,6 +3,8 @@ module IGeTui
attr_accessor
:transmission_type
,
:transmission_content
def
initialize
@transmission_type
=
0
@transmission_content
=
''
@push_info
=
nil
end
...
...
lib/igetui/template/link_template.rb
View file @
80d493c1
module
IGeTui
class
LinkTemplate
<
BaseTemplate
attr_accessor
:title
,
:text
,
:logo
,
:logo_url
,
:url
attr_accessor
:is_ring
,
:is_vibrate
,
:is_clearable
STRING_ATTRIBUTES
=
%i(title text logo logo_url url)
.
freeze
BOOLEAN_ATTRIBUTES
=
%i(is_ring is_vibrate is_clearable)
.
freeze
attr_accessor
*
STRING_ATTRIBUTES
,
*
BOOLEAN_ATTRIBUTES
def
initialize
@title
=
''
@text
=
''
@logo
=
''
@logo_url
=
''
@transmission_type
=
0
@transmission_content
=
''
@is_ring
=
true
@is_vibrate
=
true
@is_clearable
=
true
super
STRING_ATTRIBUTES
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
''
)
}
BOOLEAN_ATTRIBUTES
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
true
)
}
end
def
get_action_chain
...
...
lib/igetui/template/notification_template.rb
View file @
80d493c1
module
IGeTui
class
NotificationTemplate
<
BaseTemplate
attr_accessor
:title
,
:text
,
:logo
,
:logo_url
attr_accessor
:is_ring
,
:is_vibrate
,
:is_clearable
STRING_ATTRIBUTES
=
%i(title text logo logo_url)
.
freeze
BOOLEAN_ATTRIBUTES
=
%i(is_ring is_vibrate is_clearable)
.
freeze
attr_accessor
*
STRING_ATTRIBUTES
,
*
BOOLEAN_ATTRIBUTES
def
initialize
@title
=
''
@text
=
''
@logo
=
''
@logo_url
=
''
@transmission_type
=
0
@transmission_content
=
''
@is_ring
=
true
@is_vibrate
=
true
@is_clearable
=
true
super
STRING_ATTRIBUTES
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
''
)
}
BOOLEAN_ATTRIBUTES
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
true
)
}
end
def
get_action_chain
...
...
lib/igetui/template/noty_pop_load_template.rb
View file @
80d493c1
module
IGeTui
class
NotyPopLoadTemplate
<
BaseTemplate
attr_accessor
:title
,
:text
,
:logo
,
:logo_url
attr_accessor
:is_ring
,
:is_vibrate
,
:is_clearable
attr_accessor
:pop_title
,
:pop_text
,
:pop_image
attr_accessor
:pop_button_1
,
:pop_button_2
attr_accessor
:load_icon
,
:load_title
,
:load_url
attr_accessor
:android_mask
,
:symbia_mask
,
:ios_mask
attr_accessor
:is_auto_install
,
:is_active
STRING_ATTRIBUTES
=
%i(
title text logo logo_url
pop_title pop_text pop_image
pop_button_1 pop_button_2
load_icon load_title load_url
android_mask symbia_mask ios_mask
)
.
freeze
BOOLEAN_ATTRIBUTES_OF_TRUE
=
%i(is_ring is_vibrate is_clearable)
.
freeze
BOOLEAN_ATTRIBUTES_OF_FALSE
=
%i(is_auto_install is_active)
.
freeze
attr_accessor
*
STRING_ATTRIBUTES
,
*
BOOLEAN_ATTRIBUTES_OF_TRUE
,
*
BOOLEAN_ATTRIBUTES_OF_FALSE
def
initialize
@title
=
''
@text
=
''
@logo
=
''
@logo_url
=
''
@pop_title
=
''
@pop_text
=
''
@pop_image
=
''
@pop_button_1
=
''
@pop_button_2
=
''
@load_icon
=
''
@load_title
=
''
@load_url
=
''
@transmission_type
=
0
@transmission_content
=
''
@is_ring
=
true
@is_vibrate
=
true
@is_clearable
=
true
@android_mask
=
''
@symbia_mask
=
''
@ios_mask
=
''
@is_auto_install
=
false
@is_active
=
false
super
STRING_ATTRIBUTES
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
''
)
}
BOOLEAN_ATTRIBUTES_OF_TRUE
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
true
)
}
BOOLEAN_ATTRIBUTES_OF_FALSE
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
false
)
}
end
def
get_action_chain
...
...
lib/igetui/template/transmission_template.rb
View file @
80d493c1
module
IGeTui
class
TransmissionTemplate
<
BaseTemplate
def
initialize
@transmission_type
=
0
@transmission_content
=
''
super
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment