Class: WaCloudApi::Message::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/wa_cloud_api/message/base.rb

Direct Known Subclasses

Location, Reaction, Text

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(to:, type:) ⇒ Base

Returns a new instance of Base.



6
7
8
9
10
11
# File 'lib/wa_cloud_api/message/base.rb', line 6

def initialize(to:, type:)
  @messaging_product = 'whatsapp'
  @recipient_type = 'individual'
  @to = to
  @type = type
end

Instance Attribute Details

#messaging_productObject

Returns the value of attribute messaging_product.



4
5
6
# File 'lib/wa_cloud_api/message/base.rb', line 4

def messaging_product
  @messaging_product
end

#recipient_typeObject

Returns the value of attribute recipient_type.



4
5
6
# File 'lib/wa_cloud_api/message/base.rb', line 4

def recipient_type
  @recipient_type
end

#toObject

Returns the value of attribute to.



4
5
6
# File 'lib/wa_cloud_api/message/base.rb', line 4

def to
  @to
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/wa_cloud_api/message/base.rb', line 4

def type
  @type
end

Instance Method Details

#deliverObject



13
14
15
# File 'lib/wa_cloud_api/message/base.rb', line 13

def deliver
  Service.deliver(params: request_params)
end