Class: CKick::CompilerFlag

Inherits:
Object
  • Object
show all
Defined in:
lib/ckick/compiler_flag.rb

Direct Known Subclasses

CFlag, CXXFlag

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ CompilerFlag

Returns a new instance of CompilerFlag.



10
11
12
13
14
15
16
# File 'lib/ckick/compiler_flag.rb', line 10

def initialize args={}
  raise IllegalInitializationError, "No flag provided to compiler flag" unless args.is_a?(Hash) && !args.empty?
  flag = args[:flag] || nil
  raise BadFlagError, "Bad flag content provided to compiler flag" unless flag.is_a?(String) && !flag.empty?

  @content = args[:flag]
end

Instance Attribute Details

#contentObject (readonly)

Returns the value of attribute content.



8
9
10
# File 'lib/ckick/compiler_flag.rb', line 8

def content
  @content
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/ckick/compiler_flag.rb', line 30

def eql? other
  @content.eql? other.content
end

#hashObject



34
35
36
# File 'lib/ckick/compiler_flag.rb', line 34

def hash
  @content.hash
end

#raw_flagObject



26
27
28
# File 'lib/ckick/compiler_flag.rb', line 26

def raw_flag
  @content
end

#to_hash_elementObject



22
23
24
# File 'lib/ckick/compiler_flag.rb', line 22

def to_hash_element
  @content
end

#to_sObject



18
19
20
# File 'lib/ckick/compiler_flag.rb', line 18

def to_s
  @content
end