Module: Microstation::TagSetTrait

Included in:
Drawing
Defined in:
lib/microstation/tag_set_trait.rb

Instance Method Summary collapse

Instance Method Details

#create_tagset(name, &block) ⇒ Object



16
17
18
19
20
21
# File 'lib/microstation/tag_set_trait.rb', line 16

def create_tagset(name, &block)
  ts = tagsets.create(name)
  reset_tagsets
  block.call ts if block
  ts
end

#create_tagset!(name, &block) ⇒ Object



23
24
25
26
# File 'lib/microstation/tag_set_trait.rb', line 23

def create_tagset!(name, &block)
  remove_tagset(name)
  create_tagset(name, &block)
end

#find_tagset(name) ⇒ Object



33
34
35
# File 'lib/microstation/tag_set_trait.rb', line 33

def find_tagset(name)
  tagsets[name]
end

#remove_tagset(name) ⇒ Object



28
29
30
31
# File 'lib/microstation/tag_set_trait.rb', line 28

def remove_tagset(name)
  tagsets.remove(name)
  reset_tagsets
end

#reset_tagsetsObject



11
12
13
14
# File 'lib/microstation/tag_set_trait.rb', line 11

def reset_tagsets
  @tagsets = nil
  tagsets
end

#tagset_namesObject



7
8
9
# File 'lib/microstation/tag_set_trait.rb', line 7

def tagset_names
  tagsets.map { |ts| ts.name }
end

#tagsetsObject



3
4
5
# File 'lib/microstation/tag_set_trait.rb', line 3

def tagsets
  @tagsets ||= TagSets.new(self, ole_obj_tagsets)
end