Class: Microstation::Definition
- Inherits:
-
Object
- Object
- Microstation::Definition
- Defined in:
- lib/microstation/tag_set.rb
Instance Attribute Summary collapse
-
#tagset ⇒ Object
readonly
Returns the value of attribute tagset.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #add_attribute(name, type, options = {}) ⇒ Object
- #attribute_names ⇒ Object
- #attributes ⇒ Object
- #close ⇒ Object
- #definer ⇒ Object
- #init_definitions ⇒ Object
-
#initialize(tagset) ⇒ Definition
constructor
A new instance of Definition.
- #ole_tag_definitions ⇒ Object
- #reset ⇒ Object
Constructor Details
#initialize(tagset) ⇒ Definition
Returns a new instance of Definition.
129 130 131 |
# File 'lib/microstation/tag_set.rb', line 129 def initialize() @tagset = end |
Instance Attribute Details
#tagset ⇒ Object (readonly)
Returns the value of attribute tagset.
127 128 129 |
# File 'lib/microstation/tag_set.rb', line 127 def @tagset end |
Instance Method Details
#[](name) ⇒ Object
171 172 173 |
# File 'lib/microstation/tag_set.rb', line 171 def [](name) attributes.find{|d| d.name == name} end |
#add_attribute(name, type, options = {}) ⇒ Object
133 134 135 136 137 |
# File 'lib/microstation/tag_set.rb', line 133 def add_attribute(name,type,={}) td = definer.add_attribute(name,type,) reset td end |
#attribute_names ⇒ Object
159 160 161 |
# File 'lib/microstation/tag_set.rb', line 159 def attribute_names attributes.map{|a| a.name} end |
#attributes ⇒ Object
155 156 157 |
# File 'lib/microstation/tag_set.rb', line 155 def attributes @attributes ||= init_definitions end |
#close ⇒ Object
167 168 169 |
# File 'lib/microstation/tag_set.rb', line 167 def close attributes.each{| a| a.close} end |
#definer ⇒ Object
139 140 141 |
# File 'lib/microstation/tag_set.rb', line 139 def definer @definer ||= Definer.new() end |
#init_definitions ⇒ Object
147 148 149 150 151 152 153 |
# File 'lib/microstation/tag_set.rb', line 147 def init_definitions results = [] ole_tag_definitions.each do |ole| results << TS::Attribute.new(ole, {definer: self}) end results end |
#ole_tag_definitions ⇒ Object
143 144 145 |
# File 'lib/microstation/tag_set.rb', line 143 def ole_tag_definitions .ole_tag_definitions end |
#reset ⇒ Object
163 164 165 |
# File 'lib/microstation/tag_set.rb', line 163 def reset @attributes = nil end |