Class: JPush::TagAlias
- Inherits:
-
Object
- Object
- JPush::TagAlias
- Defined in:
- lib/jpush/model/tag_alias.rb
Instance Attribute Summary collapse
-
#add ⇒ Object
Returns the value of attribute add.
-
#alias ⇒ Object
Returns the value of attribute alias.
-
#remove ⇒ Object
Returns the value of attribute remove.
-
#tags ⇒ Object
Returns the value of attribute tags.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ TagAlias
constructor
A new instance of TagAlias.
- #toJSON ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ TagAlias
Returns a new instance of TagAlias.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jpush/model/tag_alias.rb', line 4 def initialize(opts = {}) if opts[:add] != nil if opts[:add].class == Array @add = opts[:add] else raise ArgumentError.new('add should be array.') end end if opts[:remove] != nil if opts[:remove].class == Array @remove = opts[:remove] else raise ArgumentError.new('add should be array.') end end if opts[:alias] != nil @alias = opts[:alias] end end |
Instance Attribute Details
#add ⇒ Object
Returns the value of attribute add.
3 4 5 |
# File 'lib/jpush/model/tag_alias.rb', line 3 def add @add end |
#alias ⇒ Object
Returns the value of attribute alias.
3 4 5 |
# File 'lib/jpush/model/tag_alias.rb', line 3 def alias @alias end |
#remove ⇒ Object
Returns the value of attribute remove.
3 4 5 |
# File 'lib/jpush/model/tag_alias.rb', line 3 def remove @remove end |
#tags ⇒ Object
Returns the value of attribute tags.
3 4 5 |
# File 'lib/jpush/model/tag_alias.rb', line 3 def end |
Class Method Details
.build(opts = {}) ⇒ Object
57 58 59 60 |
# File 'lib/jpush/model/tag_alias.rb', line 57 def self.build(opts = {}) tagAlias = JPush::TagAlias.new(opts) return tagAlias end |
.clear ⇒ Object
50 51 52 53 54 55 |
# File 'lib/jpush/model/tag_alias.rb', line 50 def self.clear = JPush::TagAlias.new . = '' .alias = '' return ; end |
Instance Method Details
#toJSON ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/jpush/model/tag_alias.rb', line 26 def toJSON hash = {} = {} if @add != nil ['add'] = @add end if @remove != nil ['remove'] = @remove end if @alias != nil hash['alias'] = @alias end if == '' hash['tags'] = else hash['tags'] = end return hash end |