Class: Moe::Sequence::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/moe/sequence/collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#dynaObject

Returns the value of attribute dyna.



4
5
6
# File 'lib/moe/sequence/collection.rb', line 4

def dyna
  @dyna
end

#owner_idObject (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_tablesObject (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_itemsObject



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