Class: Moe::Sequence::Collection
- Inherits:
-
Object
- Object
- Moe::Sequence::Collection
- Defined in:
- lib/moe/sequence/collection.rb
Instance Attribute Summary collapse
-
#dyna ⇒ Object
Returns the value of attribute dyna.
-
#owner_id ⇒ Object
readonly
Returns the value of attribute owner_id.
-
#read_tables ⇒ Object
readonly
Returns the value of attribute read_tables.
Instance Method Summary collapse
-
#initialize(name, owner_id) ⇒ Collection
constructor
A new instance of Collection.
- #metadata_items ⇒ Object
Constructor Details
#initialize(name, owner_id) ⇒ Collection
Returns a new instance of Collection.
7 8 9 10 11 |
# File 'lib/moe/sequence/collection.rb', line 7 def initialize(name, owner_id) @dyna = Dyna.new @owner_id = owner_id @read_tables = Moe.config.tables[name].first end |
Instance Attribute Details
#dyna ⇒ Object
Returns the value of attribute dyna.
4 5 6 |
# File 'lib/moe/sequence/collection.rb', line 4 def dyna @dyna end |
#owner_id ⇒ Object (readonly)
Returns the value of attribute owner_id.
5 6 7 |
# File 'lib/moe/sequence/collection.rb', line 5 def owner_id @owner_id end |
#read_tables ⇒ Object (readonly)
Returns the value of attribute read_tables.
5 6 7 |
# File 'lib/moe/sequence/collection.rb', line 5 def read_tables @read_tables end |
Instance Method Details
#metadata_items ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/moe/sequence/collection.rb', line 13 def [].tap do |results| read_tables.each do |table_name| dyna.dynamodb.query(request table_name).items.each do |item| results << process(table_name, item) end end end end |