Class: Microstation::Definition
- Inherits:
-
Object
- Object
- Microstation::Definition
- Defined in:
- lib/microstation/tag_set.rb
Overview
end
Instance Attribute Summary collapse
-
#tagset ⇒ Object
readonly
Returns the value of attribute tagset.
Instance Method Summary collapse
- #[](name) ⇒ Object
- #add_attribute(*args, **kwargs) {|td| ... } ⇒ Object
- #attribute_names ⇒ Object
-
#attributes ⇒ Object
def definer @definer ||= Definer.new(tagset) end.
- #close ⇒ Object
-
#initialize(tagset) ⇒ Definition
constructor
A new instance of Definition.
- #reset ⇒ Object
Constructor Details
#initialize(tagset) ⇒ Definition
Returns a new instance of Definition.
167 168 169 |
# File 'lib/microstation/tag_set.rb', line 167 def initialize() @tagset = end |
Instance Attribute Details
#tagset ⇒ Object (readonly)
Returns the value of attribute tagset.
165 166 167 |
# File 'lib/microstation/tag_set.rb', line 165 def @tagset end |
Instance Method Details
#[](name) ⇒ Object
198 199 200 |
# File 'lib/microstation/tag_set.rb', line 198 def [](name) attributes.find { |d| d.name == name } end |
#add_attribute(*args, **kwargs) {|td| ... } ⇒ Object
171 172 173 174 175 176 |
# File 'lib/microstation/tag_set.rb', line 171 def add_attribute(*args, **kwargs) td = create_attribute(*args, **kwargs) yield td if block_given? reset td end |
#attribute_names ⇒ Object
186 187 188 |
# File 'lib/microstation/tag_set.rb', line 186 def attribute_names attributes.map { |a| a.name } end |
#attributes ⇒ Object
def definer
@definer ||= Definer.new()
end
182 183 184 |
# File 'lib/microstation/tag_set.rb', line 182 def attributes @attributes ||= init_definitions end |
#close ⇒ Object
194 195 196 |
# File 'lib/microstation/tag_set.rb', line 194 def close attributes.each { |a| a.close } end |
#reset ⇒ Object
190 191 192 |
# File 'lib/microstation/tag_set.rb', line 190 def reset @attributes = nil end |