Class: Fintoc::V2::Entity

Inherits:
Object
  • Object
show all
Defined in:
lib/fintoc/v2/resources/entity.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object:, mode:, id:, holder_name:, holder_id:, is_root:, status: nil, country_code: nil, client: nil) ⇒ Entity

Returns a new instance of Entity.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fintoc/v2/resources/entity.rb', line 8

def initialize(
  object:,
  mode:,
  id:,
  holder_name:,
  holder_id:,
  is_root:,
  status: nil,
  country_code: nil,
  client: nil,
  **
)
  @object = object
  @mode = mode
  @id = id
  @holder_name = holder_name
  @holder_id = holder_id
  @is_root = is_root
  @status = status
  @country_code = country_code
  @client = client
end

Instance Attribute Details

#country_codeObject (readonly)

Returns the value of attribute country_code.



6
7
8
# File 'lib/fintoc/v2/resources/entity.rb', line 6

def country_code
  @country_code
end

#holder_idObject (readonly)

Returns the value of attribute holder_id.



6
7
8
# File 'lib/fintoc/v2/resources/entity.rb', line 6

def holder_id
  @holder_id
end

#holder_nameObject (readonly)

Returns the value of attribute holder_name.



6
7
8
# File 'lib/fintoc/v2/resources/entity.rb', line 6

def holder_name
  @holder_name
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/fintoc/v2/resources/entity.rb', line 6

def id
  @id
end

#is_rootObject (readonly)

Returns the value of attribute is_root.



6
7
8
# File 'lib/fintoc/v2/resources/entity.rb', line 6

def is_root
  @is_root
end

#modeObject (readonly)

Returns the value of attribute mode.



6
7
8
# File 'lib/fintoc/v2/resources/entity.rb', line 6

def mode
  @mode
end

#objectObject (readonly)

Returns the value of attribute object.



6
7
8
# File 'lib/fintoc/v2/resources/entity.rb', line 6

def object
  @object
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/fintoc/v2/resources/entity.rb', line 6

def status
  @status
end

Instance Method Details

#onboardingsObject



40
41
42
# File 'lib/fintoc/v2/resources/entity.rb', line 40

def onboardings
  @onboardings ||= Managers::OnboardingsManager.new(@client, @id)
end

#refreshObject



35
36
37
38
# File 'lib/fintoc/v2/resources/entity.rb', line 35

def refresh
  fresh_entity = @client.entities.get(@id)
  refresh_from_entity(fresh_entity)
end

#to_sObject



31
32
33
# File 'lib/fintoc/v2/resources/entity.rb', line 31

def to_s
  "🏢 #{@holder_name} (#{@id})"
end