Class: TableSaw::Manifest::HasManyEntry
- Inherits:
-
Object
- Object
- TableSaw::Manifest::HasManyEntry
- Defined in:
- lib/table_saw/manifest.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(table, options) ⇒ HasManyEntry
constructor
A new instance of HasManyEntry.
- #limit ⇒ Object
- #scope ⇒ Object
Constructor Details
#initialize(table, options) ⇒ HasManyEntry
Returns a new instance of HasManyEntry.
23 24 25 26 |
# File 'lib/table_saw/manifest.rb', line 23 def initialize(table, ) @table = table @options = || {} end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
21 22 23 |
# File 'lib/table_saw/manifest.rb', line 21 def @options end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
21 22 23 |
# File 'lib/table_saw/manifest.rb', line 21 def table @table end |
Class Method Details
.build(config) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/table_saw/manifest.rb', line 9 def self.build(config) config.each_with_object({}) do |(table, ), memo| case table when String memo[table] = new(table, ) when Hash table, = table.first memo[table] = new(table, ) end end end |
Instance Method Details
#limit ⇒ Object
32 33 34 |
# File 'lib/table_saw/manifest.rb', line 32 def limit ['limit'] end |
#scope ⇒ Object
28 29 30 |
# File 'lib/table_saw/manifest.rb', line 28 def scope ['scope'] end |