Class: Bh::Message

Inherits:
Data
  • Object
show all
Defined in:
lib/bh/message.rb

Overview

One message of a chat, as chat_with draws it: which side its bubble is on (:left for the other party, :right for the reader), its text, the photos it carries as a list of addresses, who the sender was, when it was said (at), how its delivery went (:delivered, :sent, :failed, :undelivered or nil) and what it cost in dollars, where anything did. Any object answering the same seven is a message too; this is for a host that has the facts and no model to hang them on. A message with neither words nor pictures yet is drawn as being typed.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(side:, text: nil, photos: [], sender: nil, at: nil, delivery: nil, cost: nil) ⇒ Message

Returns a new instance of Message.



10
11
12
# File 'lib/bh/message.rb', line 10

def initialize(side:, text: nil, photos: [], sender: nil, at: nil, delivery: nil, cost: nil)
  super
end

Instance Attribute Details

#atObject (readonly)

Returns the value of attribute at

Returns:

  • (Object)

    the current value of at



9
10
11
# File 'lib/bh/message.rb', line 9

def at
  @at
end

#costObject (readonly)

Returns the value of attribute cost

Returns:

  • (Object)

    the current value of cost



9
10
11
# File 'lib/bh/message.rb', line 9

def cost
  @cost
end

#deliveryObject (readonly)

Returns the value of attribute delivery

Returns:

  • (Object)

    the current value of delivery



9
10
11
# File 'lib/bh/message.rb', line 9

def delivery
  @delivery
end

#photosObject (readonly)

Returns the value of attribute photos

Returns:

  • (Object)

    the current value of photos



9
10
11
# File 'lib/bh/message.rb', line 9

def photos
  @photos
end

#senderObject (readonly)

Returns the value of attribute sender

Returns:

  • (Object)

    the current value of sender



9
10
11
# File 'lib/bh/message.rb', line 9

def sender
  @sender
end

#sideObject (readonly)

Returns the value of attribute side

Returns:

  • (Object)

    the current value of side



9
10
11
# File 'lib/bh/message.rb', line 9

def side
  @side
end

#textObject (readonly)

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



9
10
11
# File 'lib/bh/message.rb', line 9

def text
  @text
end