class Microstation::Tag

Constants

Value

Public Instance Methods

base_element() click to toggle source
# File lib/microstation/tag.rb, line 79
def base_element
  @base_element ||= TaggedElement.new(ole_base_element)
end
base_element=(ele) click to toggle source
# File lib/microstation/tag.rb, line 58
def base_element=(ele)
  @base_element = ele
end
base_element_id() click to toggle source
# File lib/microstation/tag.rb, line 66
def base_element_id
  base = ole_base_element
  id = base.Id || base.ID64 rescue nil
  if id.class == WIN32OLE_RECORD
    if id.Low > id.High
      return id.Low
    else
      return id.High
    end
  end
  id
end
inspect() click to toggle source
# File lib/microstation/tag.rb, line 33
def inspect
  "#{name}: #{value} ts ->#{tagset_name}"
end
name() click to toggle source
# File lib/microstation/tag.rb, line 28
def name
  @ole_obj.TagDefinitionName
end
ole_base_element() click to toggle source
# File lib/microstation/tag.rb, line 62
def ole_base_element
  @ole_obj.BaseElement
end
ole_value() click to toggle source
# File lib/microstation/tag.rb, line 24
def ole_value
  @ole_obj.Value
end
read_ole(ole) click to toggle source

def initialize(ole)

@ole_obj = ole
@original = @ole_obj.Value

end

# File lib/microstation/tag.rb, line 14
def read_ole(ole)
  ole.Value
end
tagset() click to toggle source
# File lib/microstation/tag.rb, line 45
def tagset
  @ole_obj.TagSetName
end
tagset_name() click to toggle source
# File lib/microstation/tag.rb, line 49
def tagset_name
  @ole_obj.TagSetName
end
to_s() click to toggle source
# File lib/microstation/tag.rb, line 37
def to_s
  "#{value}"
end
update_ole(value) click to toggle source
# File lib/microstation/tag.rb, line 53
def update_ole(value)
  value = value.nil? ? "" : value
  @ole_obj.Value = value
end
value() click to toggle source
# File lib/microstation/tag.rb, line 41
def value
  @original
end
write_ole(value) click to toggle source
# File lib/microstation/tag.rb, line 18
def write_ole(value)
  value = value.nil? ? "" : value
  ole_obj.Value = value
end