Class: FFI::Compiler::Flags

Inherits:
Object
  • Object
show all
Defined in:
lib/ffi-compiler/compile_task.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flags) ⇒ Flags

Returns a new instance of Flags.



19
20
21
22
# File 'lib/ffi-compiler/compile_task.rb', line 19

def initialize(flags)
  @flags = flags
  @raw = true # For backward compatibility
end

Instance Attribute Details

#rawObject

Returns the value of attribute raw.



17
18
19
# File 'lib/ffi-compiler/compile_task.rb', line 17

def raw
  @raw
end

Instance Method Details

#<<(flag) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/ffi-compiler/compile_task.rb', line 24

def <<(flag)
  if @raw
    @flags += shellsplit(flag.to_s)
  else
    @flags << flag
  end
end

#to_aObject



32
33
34
# File 'lib/ffi-compiler/compile_task.rb', line 32

def to_a
  @flags
end

#to_sObject



36
37
38
# File 'lib/ffi-compiler/compile_task.rb', line 36

def to_s
  shelljoin(@flags)
end