Class: Spaceship::Tunes::B2bOrganization

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

Defined Under Namespace

Classes: TYPE

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

#dep_customer_idString

Returns customer id.

Returns:



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

def dep_customer_id
  @dep_customer_id
end

#dep_organization_idString

Returns organization id.

Returns:

  • (String)

    organization id



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

def dep_organization_id
  @dep_organization_id
end

#nameString

Returns organization name.

Returns:

  • (String)

    organization name



15
16
17
# File 'spaceship/lib/spaceship/tunes/b2b_organization.rb', line 15

def name
  @name
end

#typeString

Returns add or remove.

Returns:



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

def type
  @type
end

Class Method Details

.from_id_info(dep_id: nil, dep_org_id: nil, dep_name: nil, type: TYPE::NO_CHANGE) ⇒ Object



31
32
33
# File 'spaceship/lib/spaceship/tunes/b2b_organization.rb', line 31

def self.from_id_info(dep_id: nil, dep_org_id: nil, dep_name: nil, type: TYPE::NO_CHANGE)
  self.new({ "value" => { "type" => type, "depCustomerId" => dep_id, "organizationId" => dep_org_id, "name" => dep_name } })
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



35
36
37
# File 'spaceship/lib/spaceship/tunes/b2b_organization.rb', line 35

def ==(other)
  other.class == self.class && other.state == self.state
end

#hashObject



45
46
47
# File 'spaceship/lib/spaceship/tunes/b2b_organization.rb', line 45

def hash
  state.hash
end

#stateObject



39
40
41
# File 'spaceship/lib/spaceship/tunes/b2b_organization.rb', line 39

def state
  return [type, dep_customer_id, name]
end