class Microstation::Definition
end
Attributes
Public Class Methods
new(tagset)
click to toggle source
# File lib/microstation/tag_set.rb, line 166 def initialize(tagset) @tagset = tagset end
Public Instance Methods
[](name)
click to toggle source
# File lib/microstation/tag_set.rb, line 198 def [](name) attributes.find{|d| d.name == name} end
add_attribute(*args, **kwargs) { |td| ... }
click to toggle source
# File lib/microstation/tag_set.rb, line 170 def add_attribute(*args, **kwargs) td = create_attribute(*args, **kwargs) yield td if block_given? reset td end
attribute_names()
click to toggle source
# File lib/microstation/tag_set.rb, line 186 def attribute_names attributes.map{|a| a.name} end
attributes()
click to toggle source
def definer
@definer ||= Definer.new(tagset)
end
# File lib/microstation/tag_set.rb, line 182 def attributes @attributes ||= init_definitions end
close()
click to toggle source
# File lib/microstation/tag_set.rb, line 194 def close attributes.each{| a| a.close} end
reset()
click to toggle source
# File lib/microstation/tag_set.rb, line 190 def reset @attributes = nil end
Protected Instance Methods
create_attribute(name,type,prompt: name, is_hidden: false, is_constant: false, default: nil) { |td| ... }
click to toggle source
# File lib/microstation/tag_set.rb, line 224 def create_attribute(name,type,prompt: name, is_hidden: false, is_constant: false, default: nil) ole_td = create_ole_definition(name, type) td = TS::Attribute.new(ole_td) td.prompt = prompt td.hidden = is_hidden td.constant = is_constant td.default = default yield td if block_given? td end
create_ole_definition(name,type)
click to toggle source
# File lib/microstation/tag_set.rb, line 212 def create_ole_definition(name,type) ole_tag_definitions.Add(name,ole_type(type)) end
init_definitions()
click to toggle source
# File lib/microstation/tag_set.rb, line 216 def init_definitions results = [] ole_tag_definitions.each do |ole| results << TS::Attribute.new(ole, {definer: self}) end results end
ole_tag_definitions()
click to toggle source
tagset.ole_tag_definitions
end
# File lib/microstation/tag_set.rb, line 208 def ole_tag_definitions @tagset.ole_obj.TagDefinitions end
ole_type(type)
click to toggle source
# File lib/microstation/tag_set.rb, line 235 def ole_type(type) TS::Attribute.tag_type(type) end