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.
104 105 106 107 |
# File 'lib/story_teller/inform/ephemeral/tag.rb', line 104 def initialize super init end |
Instance Method Details
#all_persisted_tags ⇒ Object
109 110 111 112 113 114 115 |
# File 'lib/story_teller/inform/ephemeral/tag.rb', line 109 def return [] unless Inform.tag_klass.respond_to?(:map) Inform.tag_klass.map { |a| a.name.to_sym } rescue Sequel::DatabaseError => e log.warn e. return [] end |
#init ⇒ Object Also known as: reset
117 118 119 120 121 122 |
# File 'lib/story_teller/inform/ephemeral/tag.rb', line 117 def init self.clear self.merge(StoryTeller::Library.declarations.attributes) self.merge() self end |