Class: Stupidedi::Reader::SegmentDict

Inherits:
Object
  • Object
show all
Includes:
Inspect
Defined in:
lib/stupidedi/reader/segment_dict.rb

Constructors collapse

Instance Method Summary collapse

Methods included from Inspect

#inspect

Class Method Details

.build(top) ⇒ SegmentDict::NonEmpty

Returns:

  • (SegmentDict::NonEmpty)


165
166
167
# File 'lib/stupidedi/reader/segment_dict.rb', line 165

def build(top)
  SegmentDict::Empty.push(top)
end

.emptySegmentDict::Empty

Returns:

  • (SegmentDict::Empty)


160
161
162
# File 'lib/stupidedi/reader/segment_dict.rb', line 160

def empty
  SegmentDict::Empty
end

Instance Method Details

#at(segment_id)

This method is abstract.

Searches the stack for the definition of the given segment identifier



25
# File 'lib/stupidedi/reader/segment_dict.rb', line 25

abstract :at, :args => %w(segment_id)

#defined_at?(segment_id) ⇒ Boolean

This method is abstract.

Returns true if a node in the stack has a definition for the given segment identifier

Returns:

  • (Boolean)


29
# File 'lib/stupidedi/reader/segment_dict.rb', line 29

abstract :defined_at?, :args => %w(segment_id)

#empty?Boolean

This method is abstract.

True if the stack of dictionaries is empty

Returns:

  • (Boolean)


32
# File 'lib/stupidedi/reader/segment_dict.rb', line 32

abstract :empty?

#popSegmentDict

Return the remainder of the stack. This will throw an exception if the stack is #empty?

Returns:



17
# File 'lib/stupidedi/reader/segment_dict.rb', line 17

abstract :pop

#push(top) ⇒ SegmentDict

Returns a new SegmentDict with +top+ pushed to the top of the stack

Returns:



22
# File 'lib/stupidedi/reader/segment_dict.rb', line 22

abstract :push, :args => %w(top)

#top

This method is abstract.

Return the top element from the stack. This will throw an exception if the stack is #empty?



11
# File 'lib/stupidedi/reader/segment_dict.rb', line 11

abstract :top