Class: Alephant::Lookup::LookupQuery
- Inherits:
-
Object
- Object
- Alephant::Lookup::LookupQuery
- Includes:
- Logger
- Defined in:
- lib/alephant/lookup/lookup_query.rb
Instance Attribute Summary collapse
-
#lookup_location ⇒ Object
readonly
Returns the value of attribute lookup_location.
-
#table_name ⇒ Object
readonly
Returns the value of attribute table_name.
Instance Method Summary collapse
-
#initialize(table_name, component_id, opts, batch_version) ⇒ LookupQuery
constructor
A new instance of LookupQuery.
- #run! ⇒ Object
Constructor Details
#initialize(table_name, component_id, opts, batch_version) ⇒ LookupQuery
Returns a new instance of LookupQuery.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/alephant/lookup/lookup_query.rb', line 11 def initialize(table_name, component_id, opts, batch_version) @client = AWS::DynamoDB::Client::V20120810.new @table_name = table_name @lookup_location = LookupLocation.new(component_id, opts, batch_version) logger.info( "event" => "LookupQueryInitialized", "tableName" => table_name, "componentId" => component_id, "location" => lookup_location, "batchVersion" => batch_version, "method" => "#{self.class}#initialize" ) end |
Instance Attribute Details
#lookup_location ⇒ Object (readonly)
Returns the value of attribute lookup_location.
9 10 11 |
# File 'lib/alephant/lookup/lookup_query.rb', line 9 def lookup_location @lookup_location end |
#table_name ⇒ Object (readonly)
Returns the value of attribute table_name.
9 10 11 |
# File 'lib/alephant/lookup/lookup_query.rb', line 9 def table_name @table_name end |
Instance Method Details
#run! ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/alephant/lookup/lookup_query.rb', line 26 def run! lookup_location.tap do |l| l.location = s3_location_from( @client.query(to_q) ).tap do |loc| logger.info( "event" => "S3LocationRetrieved", "location" => loc, "method" => "#{self.class}#run!" ) end end end |