Class: Bunko::Configuration::CollectionCustomizer
- Inherits:
-
Object
- Object
- Bunko::Configuration::CollectionCustomizer
- Defined in:
- lib/bunko/configuration.rb
Instance Method Summary collapse
-
#initialize(collection_hash) ⇒ CollectionCustomizer
constructor
A new instance of CollectionCustomizer.
- #post_types=(value) ⇒ Object
- #scope=(callable) ⇒ Object
- #title=(value) ⇒ Object
Constructor Details
#initialize(collection_hash) ⇒ CollectionCustomizer
Returns a new instance of CollectionCustomizer.
21 22 23 |
# File 'lib/bunko/configuration.rb', line 21 def initialize(collection_hash) @collection_hash = collection_hash end |
Instance Method Details
#post_types=(value) ⇒ Object
29 30 31 32 |
# File 'lib/bunko/configuration.rb', line 29 def post_types=(value) # Normalize post_types to array of names (using underscores, not hyphens) @collection_hash[:post_types] = Array(value).map { |pt| pt.to_s.parameterize.tr("-", "_") } end |
#scope=(callable) ⇒ Object
34 35 36 |
# File 'lib/bunko/configuration.rb', line 34 def scope=(callable) @collection_hash[:scope] = callable end |
#title=(value) ⇒ Object
25 26 27 |
# File 'lib/bunko/configuration.rb', line 25 def title=(value) @collection_hash[:title] = value end |