Class: Opencdd::Cddal::AST::ImportDecl
- Inherits:
-
Struct
- Object
- Struct
- Opencdd::Cddal::AST::ImportDecl
- Defined in:
- lib/opencdd/cddal/ast.rb
Overview
CDDAL module import declaration. Three shapes, discriminated
by kind:
:bare — textual inclusion of every named declaration
in the target. +specifier+ is the path/URL.
:qualified — target's names are accessible as
+<qualifier>.<name>+. +qualifier+ is the alias.
:selective — only the names in +imported_names+ are pulled
in, each subject to its optional rename.
Instance Attribute Summary collapse
-
#imported_names ⇒ Object
Returns the value of attribute imported_names.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#line ⇒ Object
Returns the value of attribute line.
-
#qualifier ⇒ Object
Returns the value of attribute qualifier.
-
#specifier ⇒ Object
Returns the value of attribute specifier.
Class Method Summary collapse
- .bare(specifier, line:) ⇒ Object
- .qualified(specifier, qualifier:, line:) ⇒ Object
- .selective(specifier, imported_names:, line:) ⇒ Object
Instance Method Summary collapse
-
#url ⇒ Object
Backward-compat accessor for callers that expect
url.
Instance Attribute Details
#imported_names ⇒ Object
Returns the value of attribute imported_names
57 58 59 |
# File 'lib/opencdd/cddal/ast.rb', line 57 def imported_names @imported_names end |
#kind ⇒ Object
Returns the value of attribute kind
57 58 59 |
# File 'lib/opencdd/cddal/ast.rb', line 57 def kind @kind end |
#line ⇒ Object
Returns the value of attribute line
57 58 59 |
# File 'lib/opencdd/cddal/ast.rb', line 57 def line @line end |
#qualifier ⇒ Object
Returns the value of attribute qualifier
57 58 59 |
# File 'lib/opencdd/cddal/ast.rb', line 57 def qualifier @qualifier end |
#specifier ⇒ Object
Returns the value of attribute specifier
57 58 59 |
# File 'lib/opencdd/cddal/ast.rb', line 57 def specifier @specifier end |
Class Method Details
.bare(specifier, line:) ⇒ Object
61 62 63 |
# File 'lib/opencdd/cddal/ast.rb', line 61 def self.(specifier, line:) new(specifier: specifier, kind: :bare, line: line) end |
.qualified(specifier, qualifier:, line:) ⇒ Object
65 66 67 |
# File 'lib/opencdd/cddal/ast.rb', line 65 def self.qualified(specifier, qualifier:, line:) new(specifier: specifier, kind: :qualified, qualifier: qualifier, line: line) end |
.selective(specifier, imported_names:, line:) ⇒ Object
69 70 71 |
# File 'lib/opencdd/cddal/ast.rb', line 69 def self.selective(specifier, imported_names:, line:) new(specifier: specifier, kind: :selective, imported_names: imported_names, line: line) end |
Instance Method Details
#url ⇒ Object
Backward-compat accessor for callers that expect url.
74 75 76 |
# File 'lib/opencdd/cddal/ast.rb', line 74 def url specifier end |