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
ac9fca4b
Commit
ac9fca4b
authored
Aug 22, 2014
by
Victor Wang
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12 from wjp2013/develop
重构模板的初始化方法
parents
c816119d
80d493c1
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 @
ac9fca4b
...
@@ -3,6 +3,8 @@ module IGeTui
...
@@ -3,6 +3,8 @@ module IGeTui
attr_accessor
:transmission_type
,
:transmission_content
attr_accessor
:transmission_type
,
:transmission_content
def
initialize
def
initialize
@transmission_type
=
0
@transmission_content
=
''
@push_info
=
nil
@push_info
=
nil
end
end
...
...
lib/igetui/template/link_template.rb
View file @
ac9fca4b
module
IGeTui
module
IGeTui
class
LinkTemplate
<
BaseTemplate
class
LinkTemplate
<
BaseTemplate
attr_accessor
:title
,
:text
,
:logo
,
:logo_url
,
:url
STRING_ATTRIBUTES
=
%i(title text logo logo_url url)
.
freeze
attr_accessor
:is_ring
,
:is_vibrate
,
:is_clearable
BOOLEAN_ATTRIBUTES
=
%i(is_ring is_vibrate is_clearable)
.
freeze
attr_accessor
*
STRING_ATTRIBUTES
,
*
BOOLEAN_ATTRIBUTES
def
initialize
def
initialize
@title
=
''
@text
=
''
@logo
=
''
@logo_url
=
''
@transmission_type
=
0
@transmission_content
=
''
@is_ring
=
true
@is_vibrate
=
true
@is_clearable
=
true
super
super
STRING_ATTRIBUTES
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
''
)
}
BOOLEAN_ATTRIBUTES
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
true
)
}
end
end
def
get_action_chain
def
get_action_chain
...
...
lib/igetui/template/notification_template.rb
View file @
ac9fca4b
module
IGeTui
module
IGeTui
class
NotificationTemplate
<
BaseTemplate
class
NotificationTemplate
<
BaseTemplate
attr_accessor
:title
,
:text
,
:logo
,
:logo_url
STRING_ATTRIBUTES
=
%i(title text logo logo_url)
.
freeze
attr_accessor
:is_ring
,
:is_vibrate
,
:is_clearable
BOOLEAN_ATTRIBUTES
=
%i(is_ring is_vibrate is_clearable)
.
freeze
attr_accessor
*
STRING_ATTRIBUTES
,
*
BOOLEAN_ATTRIBUTES
def
initialize
def
initialize
@title
=
''
@text
=
''
@logo
=
''
@logo_url
=
''
@transmission_type
=
0
@transmission_content
=
''
@is_ring
=
true
@is_vibrate
=
true
@is_clearable
=
true
super
super
STRING_ATTRIBUTES
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
''
)
}
BOOLEAN_ATTRIBUTES
.
each
{
|
attr
|
instance_variable_set
(
"@
#{
attr
}
"
,
true
)
}
end
end
def
get_action_chain
def
get_action_chain
...
...
lib/igetui/template/noty_pop_load_template.rb
View file @
ac9fca4b
module
IGeTui
module
IGeTui
class
NotyPopLoadTemplate
<
BaseTemplate
class
NotyPopLoadTemplate
<
BaseTemplate
attr_accessor
:title
,
:text
,
:logo
,
:logo_url
STRING_ATTRIBUTES
=
%i(
attr_accessor
:is_ring
,
:is_vibrate
,
:is_clearable
title text logo logo_url
attr_accessor
:pop_title
,
:pop_text
,
:pop_image
pop_title pop_text pop_image
attr_accessor
:pop_button_1
,
:pop_button_2
pop_button_1 pop_button_2
attr_accessor
:load_icon
,
:load_title
,
:load_url
load_icon load_title load_url
attr_accessor
:android_mask
,
:symbia_mask
,
:ios_mask
android_mask symbia_mask ios_mask
attr_accessor
:is_auto_install
,
:is_active
)
.
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
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
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
end
def
get_action_chain
def
get_action_chain
...
...
lib/igetui/template/transmission_template.rb
View file @
ac9fca4b
module
IGeTui
module
IGeTui
class
TransmissionTemplate
<
BaseTemplate
class
TransmissionTemplate
<
BaseTemplate
def
initialize
def
initialize
@transmission_type
=
0
@transmission_content
=
''
super
super
end
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