Class: Comet::DSL::Linker
- Inherits:
-
Object
- Object
- Comet::DSL::Linker
- Includes:
- Helpers
- Defined in:
- lib/comet/dsl/linker.rb
Instance Attribute Summary collapse
-
#cpu ⇒ Object
readonly
Returns the value of attribute cpu.
-
#isa ⇒ Object
readonly
Returns the value of attribute isa.
-
#opt ⇒ Object
readonly
Returns the value of attribute opt.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#triple ⇒ Object
readonly
Returns the value of attribute triple.
Instance Method Summary collapse
-
#initialize(triple, isa:, cpu:, opt:, &block) ⇒ Linker
constructor
A new instance of Linker.
- #option(*args, **kwargs) ⇒ Object
- #script(script) ⇒ Object
- #script_ ⇒ Object
- #to_s ⇒ Object
- #validate! ⇒ Object
Methods included from Helpers
Constructor Details
#initialize(triple, isa:, cpu:, opt:, &block) ⇒ Linker
Returns a new instance of Linker.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/comet/dsl/linker.rb', line 15 def initialize(triple, isa:, cpu:, opt:, &block) @triple = triple @isa = isa @cpu = cpu @options = Options.new @opt = opt @script = nil instance_exec(&block) if block_given? end |
Instance Attribute Details
#cpu ⇒ Object (readonly)
Returns the value of attribute cpu.
32 33 34 |
# File 'lib/comet/dsl/linker.rb', line 32 def cpu @cpu end |
#isa ⇒ Object (readonly)
Returns the value of attribute isa.
31 32 33 |
# File 'lib/comet/dsl/linker.rb', line 31 def isa @isa end |
#opt ⇒ Object (readonly)
Returns the value of attribute opt.
34 35 36 |
# File 'lib/comet/dsl/linker.rb', line 34 def opt @opt end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
33 34 35 |
# File 'lib/comet/dsl/linker.rb', line 33 def @options end |
#triple ⇒ Object (readonly)
Returns the value of attribute triple.
30 31 32 |
# File 'lib/comet/dsl/linker.rb', line 30 def triple @triple end |
Instance Method Details
#option(*args, **kwargs) ⇒ Object
11 12 13 |
# File 'lib/comet/dsl/linker.rb', line 11 def option(*args, **kwargs) @options.add('', *args, **kwargs) end |
#script(script) ⇒ Object
7 8 9 |
# File 'lib/comet/dsl/linker.rb', line 7 def script(script) @script = script end |
#script_ ⇒ Object
36 37 38 |
# File 'lib/comet/dsl/linker.rb', line 36 def script_ @script end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/comet/dsl/linker.rb', line 26 def to_s "linker #{@triple}" end |
#validate! ⇒ Object
40 41 42 |
# File 'lib/comet/dsl/linker.rb', line 40 def validate! raise "#{self} triple is invalid" if @triple.strip.empty? end |