Class: Bas::SharedStorage::Types::Read

Inherits:
Object
  • Object
show all
Defined in:
lib/bas/shared_storage/types/read.rb

Overview

Represents a response from a read component. It encapsulates the requested data from the shared storage to be processed by a Bot.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id = nil, response = nil, inserted_at = nil) ⇒ Read

Returns a new instance of Read.



14
15
16
17
18
# File 'lib/bas/shared_storage/types/read.rb', line 14

def initialize(id = nil, response = nil, inserted_at = nil)
  @id = id
  @data = response.nil? ? {} : JSON.parse(response)
  @inserted_at = inserted_at
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



12
13
14
# File 'lib/bas/shared_storage/types/read.rb', line 12

def data
  @data
end

#idObject (readonly)

Returns the value of attribute id.



12
13
14
# File 'lib/bas/shared_storage/types/read.rb', line 12

def id
  @id
end

#inserted_atObject (readonly)

Returns the value of attribute inserted_at.



12
13
14
# File 'lib/bas/shared_storage/types/read.rb', line 12

def inserted_at
  @inserted_at
end