Class: StoryTeller::Library::Declarations

Inherits:
Object
  • Object
show all
Defined in:
lib/story_teller/library/declarations.rb

Overview

The StoryTeller::Library::Declarations class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeDeclarations

Returns a new instance of Declarations.



30
31
32
# File 'lib/story_teller/library/declarations.rb', line 30

def initialize
  reset!
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



28
29
30
# File 'lib/story_teller/library/declarations.rb', line 28

def attributes
  @attributes
end

#globalsObject (readonly)

Returns the value of attribute globals.



28
29
30
# File 'lib/story_teller/library/declarations.rb', line 28

def globals
  @globals
end

#propertiesObject (readonly)

Returns the value of attribute properties.



28
29
30
# File 'lib/story_teller/library/declarations.rb', line 28

def properties
  @properties
end

Instance Method Details

#add_attribute(attribute) ⇒ Object



40
41
42
# File 'lib/story_teller/library/declarations.rb', line 40

def add_attribute(attribute)
  @attributes << attribute
end

#add_global(symbol) ⇒ Object



48
49
50
# File 'lib/story_teller/library/declarations.rb', line 48

def add_global(symbol)
  @globals << symbol
end

#add_property(property, value) ⇒ Object



44
45
46
# File 'lib/story_teller/library/declarations.rb', line 44

def add_property(property, value)
  @properties[property] << value
end

#reset!Object



34
35
36
37
38
# File 'lib/story_teller/library/declarations.rb', line 34

def reset!
  @properties = Hash.new { |hash, key| hash[key] = [] }
  @attributes = Set.new
  @globals = []
end