Class: Microstation::Drawing::Number
- Inherits:
-
Object
- Object
- Microstation::Drawing::Number
- Defined in:
- lib/microstation/extensions/faa.rb,
lib/microstation/extensions/faa.rb
Constant Summary collapse
- DRAWING_RE =
/(.+)-.+-(.+)-(.+).dgn/
Instance Attribute Summary collapse
-
#factype ⇒ Object
readonly
Returns the value of attribute factype.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#locid ⇒ Object
readonly
Returns the value of attribute locid.
Class Method Summary collapse
Instance Method Summary collapse
- #+(other) ⇒ Object
- #-(other) ⇒ Object
- #discipline ⇒ Object
- #Index(str) ⇒ Object
-
#initialize(locid, factype, index) ⇒ Number
constructor
A new instance of Number.
- #to_s ⇒ Object
Constructor Details
Instance Attribute Details
#factype ⇒ Object (readonly)
Returns the value of attribute factype.
30 31 32 |
# File 'lib/microstation/extensions/faa.rb', line 30 def factype @factype end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
30 31 32 |
# File 'lib/microstation/extensions/faa.rb', line 30 def index @index end |
#locid ⇒ Object (readonly)
Returns the value of attribute locid.
30 31 32 |
# File 'lib/microstation/extensions/faa.rb', line 30 def locid @locid end |
Class Method Details
.from_string(drawing_name) ⇒ Object
18 19 20 21 |
# File 'lib/microstation/extensions/faa.rb', line 18 def self.from_string(drawing_name) md = DRAWING_RE.match(drawing_name.to_s) new(md[1], md[2], md[3]) end |
Instance Method Details
#+(other) ⇒ Object
46 47 48 |
# File 'lib/microstation/extensions/faa.rb', line 46 def +(other) self.class.new(locid, factype, index.+(other)) end |
#-(other) ⇒ Object
50 51 52 |
# File 'lib/microstation/extensions/faa.rb', line 50 def -(other) self.class.new(locid, factype, index.-(other)) end |
#discipline ⇒ Object
42 43 44 |
# File 'lib/microstation/extensions/faa.rb', line 42 def discipline index.discipline end |
#Index(str) ⇒ Object
23 24 25 26 |
# File 'lib/microstation/extensions/faa.rb', line 23 def Index(str) return str if str == Drawing::Index Drawing::Index.new(str.to_s) end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/microstation/extensions/faa.rb', line 38 def to_s [locid, "D", factype, index.to_s].join("-") end |