Class: Spaceship::Tunes::B2bUser

Inherits:
TunesBase show all
Defined in:
spaceship/lib/spaceship/tunes/b2b_user.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#client, #raw_data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TunesBase

client

Methods inherited from Base

attr_accessor, attr_mapping, attributes, #attributes, factory, #initialize, #inspect, mapping_module, method_missing, set_client, #setup, #to_s

Constructor Details

This class inherits a constructor from Spaceship::Base

Instance Attribute Details

#addBool

Returns add the user to b2b list.

Returns:

  • (Bool)

    add the user to b2b list



6
7
8
# File 'spaceship/lib/spaceship/tunes/b2b_user.rb', line 6

def add
  @add
end

#deleteBool

Returns delete the user to b2b list.

Returns:

  • (Bool)

    delete the user to b2b list



9
10
11
# File 'spaceship/lib/spaceship/tunes/b2b_user.rb', line 9

def delete
  @delete
end

#ds_usernameString

Returns b2b username.

Returns:



12
13
14
# File 'spaceship/lib/spaceship/tunes/b2b_user.rb', line 12

def ds_username
  @ds_username
end

Class Method Details

.from_username(username, is_add_type: true) ⇒ Object



20
21
22
# File 'spaceship/lib/spaceship/tunes/b2b_user.rb', line 20

def self.from_username(username, is_add_type: true)
  self.new({ 'value' => { 'add' => is_add_type, 'delete' => !is_add_type, 'dsUsername' => username } })
end

Instance Method Details

#==(other) ⇒ Object

equality check for the two objects



25
26
27
# File 'spaceship/lib/spaceship/tunes/b2b_user.rb', line 25

def ==(other)
  add == other.add && delete == other.delete && ds_username == other.ds_username
end