Class: Ottogen::Collection
- Inherits:
-
Object
- Object
- Ottogen::Collection
- Defined in:
- lib/ottogen/collection.rb
Constant Summary collapse
- DIR_PREFIX =
'_'
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, output:) ⇒ Collection
constructor
A new instance of Collection.
- #output? ⇒ Boolean
Constructor Details
#initialize(name:, output:) ⇒ Collection
Returns a new instance of Collection.
16 17 18 19 20 |
# File 'lib/ottogen/collection.rb', line 16 def initialize(name:, output:) @name = name @output = output @items = discover_items end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
14 15 16 |
# File 'lib/ottogen/collection.rb', line 14 def items @items end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
14 15 16 |
# File 'lib/ottogen/collection.rb', line 14 def name @name end |
Class Method Details
.from_config(name, settings) ⇒ Object
9 10 11 12 |
# File 'lib/ottogen/collection.rb', line 9 def self.from_config(name, settings) output = settings.is_a?(Hash) && settings['output'] == true new(name: name, output: output) end |
Instance Method Details
#output? ⇒ Boolean
22 23 24 |
# File 'lib/ottogen/collection.rb', line 22 def output? @output end |