Class: SML::Treepath

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-sml/sml-treepath.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path_entry) ⇒ Treepath

Returns a new instance of Treepath.



8
9
10
# File 'lib/ruby-sml/sml-treepath.rb', line 8

def initialize(path_entry)
  @path_entry = path_entry
end

Instance Attribute Details

#path_entryObject

Returns the value of attribute path_entry.



6
7
8
# File 'lib/ruby-sml/sml-treepath.rb', line 6

def path_entry
  @path_entry
end

Class Method Details

.construct(array_rep) ⇒ Object



12
13
14
15
16
17
# File 'lib/ruby-sml/sml-treepath.rb', line 12

def self.construct(array_rep)
  return nil if array_rep.nil?
  path_entry = array_rep.shift
  
  return SML::Treepath.new(path_entry)
end

Instance Method Details

#to_aObject



18
19
20
# File 'lib/ruby-sml/sml-treepath.rb', line 18

def to_a
  return [] << path_entry
end