class CKick::CompilerFlag

represents a compiler flag to pass to the compiler

Attributes

content[R]

raw flag

Public Class Methods

new(args={}) click to toggle source

Input hash keys

  • :flag - raw flag content, must be String

# File lib/ckick/compiler_flag.rb, line 16
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

Public Instance Methods

eql?(other) click to toggle source

overrides Object#eql? for uniqueness

# File lib/ckick/compiler_flag.rb, line 40
def eql? other
  @content.eql? other.content
end
hash() click to toggle source

overrides Object#hash for uniqueness

# File lib/ckick/compiler_flag.rb, line 45
def hash
  @content.hash
end
raw_flag() click to toggle source

raw flag

# File lib/ckick/compiler_flag.rb, line 35
def raw_flag
  @content
end
to_hash_element() click to toggle source

converts to hash element: String

# File lib/ckick/compiler_flag.rb, line 30
def to_hash_element
  @content
end
to_s() click to toggle source

converts to String, flag as is

# File lib/ckick/compiler_flag.rb, line 25
def to_s
  @content
end