Class: MessagebirdTexter::Response::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/messagebird_texter/response/body.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ Body

Returns a new instance of Body.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/messagebird_texter/response/body.rb', line 21

def initialize(body)
  parsed_body         = JSON.parse(body, symbolize_names: true)
  @id                 = parsed_body[:id]
  @href               = parsed_body[:href]
  @direction          = parsed_body[:direction]
  @type               = parsed_body[:type]
  @originator         = parsed_body[:originator]
  @content            = parsed_body[:body]
  @reference          = parsed_body[:reference]
  @validity           = parsed_body[:validity]
  @gateway            = parsed_body[:gateway]
  @datacoding         = parsed_body[:datacoding]
  @mclass             = parsed_body[:mclass]
  @scheduled_datetime = parsed_body[:scheduledDatetime]
  @created_datetime   = parsed_body[:createdDatetime]
  @recipients         = parsed_body[:recipients]
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def content
  @content
end

#created_datetimeObject (readonly)

Returns the value of attribute created_datetime.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def created_datetime
  @created_datetime
end

#datacodingObject (readonly)

Returns the value of attribute datacoding.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def datacoding
  @datacoding
end

#directionObject (readonly)

Returns the value of attribute direction.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def direction
  @direction
end

#gatewayObject (readonly)

Returns the value of attribute gateway.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def gateway
  @gateway
end

#hrefObject (readonly)

Returns the value of attribute href.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def href
  @href
end

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def id
  @id
end

#mclassObject (readonly)

Returns the value of attribute mclass.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def mclass
  @mclass
end

#originatorObject (readonly)

Returns the value of attribute originator.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def originator
  @originator
end

#recipientsObject (readonly)

Returns the value of attribute recipients.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def recipients
  @recipients
end

#referenceObject (readonly)

Returns the value of attribute reference.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def reference
  @reference
end

#scheduled_datetimeObject (readonly)

Returns the value of attribute scheduled_datetime.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def scheduled_datetime
  @scheduled_datetime
end

#typeObject (readonly)

Returns the value of attribute type.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def type
  @type
end

#validityObject (readonly)

Returns the value of attribute validity.



6
7
8
# File 'lib/messagebird_texter/response/body.rb', line 6

def validity
  @validity
end