class Glaemscribe::API::Sheaf

Constants

SHEAF_SEPARATOR

Attributes

expression[R]
fragments[R]
linkable[R]
mode[R]
rule[R]
sheaf_chain[R]

Public Class Methods

new(sheaf_chain, expression, linkable) click to toggle source

Should pass a sheaf expression, e.g. : “h, s, t”

# File lib/api/sheaf.rb, line 48
def initialize(sheaf_chain, expression, linkable)
  
  @linkable     = linkable
  @sheaf_chain  = sheaf_chain
  @mode         = sheaf_chain.mode
  @rule         = sheaf_chain.rule
  @expression   = expression
  
  # Split members using "*" separator, KEEP NULL MEMBERS (this is legal)
  fragment_exps = expression.split(SHEAF_SEPARATOR,-1).map{|fragment_exp| fragment_exp.strip } 
  fragment_exps = [""] if fragment_exps.empty? # For NULL
           
  # Build the fragments inside
  @fragments = fragment_exps.map{ |fragment_exp|  Fragment.new(self, fragment_exp) }
end

Public Instance Methods

dst?() click to toggle source
# File lib/api/sheaf.rb, line 45
def dst?; @sheaf_chain.dst?; end
p() click to toggle source
# File lib/api/sheaf.rb, line 64
def p
  ret = "-- " + @expression + "\n"
  @fragments.each{ |l|
    ret += l.p
  }
  ret
end
src?() click to toggle source
# File lib/api/sheaf.rb, line 44
def src?; @sheaf_chain.src?; end