Module: JPush::Helper::ArgumentHelper
- Extended by:
- Argument
- Included in:
- Alias, Device, Push, Push::Audience, Push::Notification, Push::PushPayload, Report, Schedule, Schedule::SchedulePayload, Schedule::Trigger, Tag
- Defined in:
- lib/jpush/helper/argument_helper.rb
Constant Summary
collapse
- MAX_TAG_ARRAY_SZIE =
100
- MAX_ALIAS_ARRAY_SIZE =
1000
- MAX_REGISTRATION_ID_ARRAY_SIZE =
1000
- MAX_TAG_ARRAY_MAX_BYTESIZE =
1024
- MAX_MSG_IDS_ARRAY_SIZE =
100
Constants included
from Argument
JPush::Helper::Argument::MAX_ALIAS_BYTESIZE, JPush::Helper::Argument::MAX_TAG_BYTESIZE, JPush::Helper::Argument::MOBILE_RE
Class Method Summary
collapse
Instance Method Summary
collapse
Methods included from Argument
check_alias, check_mobile, check_platform, check_registration_id, check_tag, ensure_argument_not_blank, ensure_argument_required, ensure_not_over_bytesize, ensure_not_over_size, ensure_word_valid
Class Method Details
.extended(base) ⇒ Object
16
17
18
|
# File 'lib/jpush/helper/argument_helper.rb', line 16
def self.extended(base)
base.extend Argument
end
|
Instance Method Details
#build_alias(alis) ⇒ Object
30
31
32
|
# File 'lib/jpush/helper/argument_helper.rb', line 30
def build_alias(alis)
build_args_from_array_or_string('alias', alis, MAX_ALIAS_ARRAY_SIZE)
end
|
38
39
40
|
# File 'lib/jpush/helper/argument_helper.rb', line 38
def ()
(.nil? || !.is_a?(Hash) || .empty?) ? nil :
end
|
#build_msg_ids(msg_ids) ⇒ Object
34
35
36
|
# File 'lib/jpush/helper/argument_helper.rb', line 34
def build_msg_ids(msg_ids)
build_args_from_array_or_string('msg ids', msg_ids, MAX_MSG_IDS_ARRAY_SIZE)
end
|
42
43
44
|
# File 'lib/jpush/helper/argument_helper.rb', line 42
def build_platform(platform)
[platform].flatten.each{ |pf| check_platform(pf) }
end
|
#build_registration_ids(ids) ⇒ Object
26
27
28
|
# File 'lib/jpush/helper/argument_helper.rb', line 26
def build_registration_ids(ids)
build_args_from_array_or_string('registration ids', ids, MAX_REGISTRATION_ID_ARRAY_SIZE)
end
|
20
21
22
23
24
|
# File 'lib/jpush/helper/argument_helper.rb', line 20
def build_tags(tags, max_size = MAX_TAG_ARRAY_SZIE)
tags = build_args_from_array_or_string('tags', tags, max_size)
ensure_not_over_bytesize('tags', tags, MAX_TAG_ARRAY_MAX_BYTESIZE)
tags
end
|