Class: Inform::TagRegistry
- Defined in:
- lib/story_teller/inform/ephemeral/tag.rb
Overview
The TagRegistry class
Constant Summary collapse
- SINGLETON =
Struct.new(:memo).new
Instance Method Summary collapse
- #all_persisted_tags ⇒ Object
- #init ⇒ Object (also: #reset)
-
#initialize ⇒ TagRegistry
constructor
A new instance of TagRegistry.
Methods inherited from Set
Constructor Details
#initialize ⇒ TagRegistry
Returns a new instance of TagRegistry.
103 104 105 106 |
# File 'lib/story_teller/inform/ephemeral/tag.rb', line 103 def initialize super init end |
Instance Method Details
#all_persisted_tags ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/story_teller/inform/ephemeral/tag.rb', line 108 def return [] unless Inform::Tag.respond_to?(:map) Inform::Tag.map { |a| a.name.to_sym } rescue Sequel::DatabaseError => e log.warn e. return [] end |
#init ⇒ Object Also known as: reset
116 117 118 119 120 121 |
# File 'lib/story_teller/inform/ephemeral/tag.rb', line 116 def init self.clear self.merge(StoryTeller::Library.declarations.attributes) self.merge() self end |