Class: Sendly::TenDlcBrand

Inherits:
Object
  • Object
show all
Defined in:
lib/sendly/tendlc_resource.rb

Overview

A business identity registered for carrier review. The status starts "pending" and moves to "verified" (campaigns can be created) or "failed" (see failure_reasons).

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ TenDlcBrand

Returns a new instance of TenDlcBrand.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/sendly/tendlc_resource.rb', line 12

def initialize(data)
  @id = data["id"]
  @legal_name = data["legalName"] || data["legal_name"]
  @dba = data["dba"]
  @entity_type = data["entityType"] || data["entity_type"]
  @ein = data["ein"]
  @vertical = data["vertical"]
  @website = data["website"]
  @status = data["status"]
  @identity_status = data["identityStatus"] || data["identity_status"]
  @failure_reasons = data["failureReasons"] || data["failure_reasons"]
  @created_at = data["createdAt"] || data["created_at"]
  @updated_at = data["updatedAt"] || data["updated_at"]
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def created_at
  @created_at
end

#dbaObject (readonly)

Returns the value of attribute dba.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def dba
  @dba
end

#einObject (readonly)

Returns the value of attribute ein.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def ein
  @ein
end

#entity_typeObject (readonly)

Returns the value of attribute entity_type.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def entity_type
  @entity_type
end

#failure_reasonsObject (readonly)

Returns the value of attribute failure_reasons.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def failure_reasons
  @failure_reasons
end

#idObject (readonly)

Returns the value of attribute id.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def id
  @id
end

#identity_statusObject (readonly)

Returns the value of attribute identity_status.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def identity_status
  @identity_status
end

Returns the value of attribute legal_name.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def legal_name
  @legal_name
end

#statusObject (readonly)

Returns the value of attribute status.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def status
  @status
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def updated_at
  @updated_at
end

#verticalObject (readonly)

Returns the value of attribute vertical.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def vertical
  @vertical
end

#websiteObject (readonly)

Returns the value of attribute website.



8
9
10
# File 'lib/sendly/tendlc_resource.rb', line 8

def website
  @website
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


35
36
37
# File 'lib/sendly/tendlc_resource.rb', line 35

def failed?
  status == "failed"
end

#pending?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/sendly/tendlc_resource.rb', line 27

def pending?
  status == "pending"
end

#to_hObject



39
40
41
42
43
44
45
46
# File 'lib/sendly/tendlc_resource.rb', line 39

def to_h
  {
    id: id, legal_name: legal_name, dba: dba, entity_type: entity_type,
    ein: ein, vertical: vertical, website: website, status: status,
    identity_status: identity_status, failure_reasons: failure_reasons,
    created_at: created_at, updated_at: updated_at
  }.compact
end

#verified?Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/sendly/tendlc_resource.rb', line 31

def verified?
  status == "verified"
end