class Spread2RDF::Schema::Element

Attributes

block[R]
parent[R]

Public Class Methods

new(parent, attr = {}, &block) click to toggle source
# File lib/spread2rdf/schema/element.rb, line 19
def initialize(parent, attr = {}, &block)
  @parent   = parent
  @block    = block
  init_attributes(attr)
end

Public Instance Methods

name() click to toggle source
# File lib/spread2rdf/schema/element.rb, line 25
def name
  (@name or @source_name).try(:to_sym)
end
source_name() click to toggle source
# File lib/spread2rdf/schema/element.rb, line 29
def source_name
  (@source_name or @name).try(:to_s)
end
to_s() click to toggle source
# File lib/spread2rdf/schema/element.rb, line 40
def to_s
  name = (self.name.to_s == self.source_name.to_s ?
      self.name : "#{self.name} (#{self.source_name})" )
  "#{self.class.name.split('::').last}-schema #{name}"
end
worksheet() click to toggle source
# File lib/spread2rdf/schema/element.rb, line 33
def worksheet
  return self if self.is_a? Worksheet
  parent = self.parent
  parent = parent.parent until parent.is_a? Worksheet or parent.nil?
  parent
end