Class: CKick::CompilerFlag
- Inherits:
-
Object
- Object
- CKick::CompilerFlag
- Defined in:
- lib/ckick/compiler_flag.rb
Overview
represents a compiler flag to pass to the compiler
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
raw flag.
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
overrides Object#eql? for uniqueness.
-
#hash ⇒ Object
overrides Object#hash for uniqueness.
-
#initialize(args = {}) ⇒ CompilerFlag
constructor
-
args
- Hash containing flag data as String ==== Input hash keys *:flag
- raw flag content, must be String.
-
-
#raw_flag ⇒ Object
raw flag.
-
#to_hash_element ⇒ Object
converts to hash element: String.
-
#to_s ⇒ Object
converts to String, flag as is.
Constructor Details
#initialize(args = {}) ⇒ CompilerFlag
-
args
- Hash containing flag data as String
Input hash keys
-
:flag
- raw flag content, must be String
16 17 18 19 20 21 22 |
# 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 |
Instance Attribute Details
#content ⇒ Object (readonly)
raw flag
11 12 13 |
# File 'lib/ckick/compiler_flag.rb', line 11 def content @content end |
Instance Method Details
#eql?(other) ⇒ Boolean
overrides Object#eql? for uniqueness
40 41 42 |
# File 'lib/ckick/compiler_flag.rb', line 40 def eql? other @content.eql? other.content end |
#hash ⇒ Object
overrides Object#hash for uniqueness
45 46 47 |
# File 'lib/ckick/compiler_flag.rb', line 45 def hash @content.hash end |
#raw_flag ⇒ Object
raw flag
35 36 37 |
# File 'lib/ckick/compiler_flag.rb', line 35 def raw_flag @content end |
#to_hash_element ⇒ Object
converts to hash element: String
30 31 32 |
# File 'lib/ckick/compiler_flag.rb', line 30 def to_hash_element @content end |
#to_s ⇒ Object
converts to String, flag as is
25 26 27 |
# File 'lib/ckick/compiler_flag.rb', line 25 def to_s @content end |