Class: Bas::SharedStorage::Types::Read
- Inherits:
-
Object
- Object
- Bas::SharedStorage::Types::Read
- 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
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#inserted_at ⇒ Object
readonly
Returns the value of attribute inserted_at.
Instance Method Summary collapse
-
#initialize(id = nil, response = nil, inserted_at = nil) ⇒ Read
constructor
A new instance of Read.
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
12 13 14 |
# File 'lib/bas/shared_storage/types/read.rb', line 12 def data @data end |
#id ⇒ Object (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_at ⇒ Object (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 |