Class: Microstation::Definer

Inherits:
Object
  • Object
show all
Defined in:
lib/microstation/tag_set.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tagset) ⇒ Definer



88
89
90
# File 'lib/microstation/tag_set.rb', line 88

def initialize(tagset)
  @tagset = tagset
end

Instance Attribute Details

#tagsetObject (readonly)

Returns the value of attribute tagset.



86
87
88
# File 'lib/microstation/tag_set.rb', line 86

def tagset
  @tagset
end

Instance Method Details

#add_attribute(name, type, options = {}) {|td| ... } ⇒ Object

Yields:

  • (td)


93
94
95
96
97
98
99
100
101
102
103
# File 'lib/microstation/tag_set.rb', line 93

def add_attribute(name,type,options = {})
  ole_td = create_ole_definition(name, type)
  td = TS::Attribute.new(ole_td)
  td.prompt = options[:prompt] || name
  td.hidden = options[:is_hidden]
  td.constant = options[:is_constant] || false
  td.default = options[:default] if options[:default]
  #td.hidden = td.fetch(:is_hidden)
  yield td if block_given?
  td
end