Class: Rubycc::Rmake::Variable
- Inherits:
-
Object
- Object
- Rubycc::Rmake::Variable
- Defined in:
- lib/rubycc/rmake/model.rb
Overview
A make variable. The flavor decides when the right-hand side is expanded:
a recursive (=) variable keeps its text verbatim and is expanded afresh
on every reference, so it can see values defined later; a simple (:=)
variable is expanded once at definition and thereafter holds a plain
string. ?= produces a recursive variable (only when the name is unset)
and += appends in whichever flavor the variable already has.
Instance Attribute Summary collapse
-
#flavor ⇒ Object
readonly
Returns the value of attribute flavor.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(flavor, value) ⇒ Variable
constructor
A new instance of Variable.
- #recursive? ⇒ Boolean
- #simple? ⇒ Boolean
Constructor Details
#initialize(flavor, value) ⇒ Variable
Returns a new instance of Variable.
14 15 16 17 |
# File 'lib/rubycc/rmake/model.rb', line 14 def initialize(flavor, value) @flavor = flavor @value = value end |
Instance Attribute Details
#flavor ⇒ Object (readonly)
Returns the value of attribute flavor.
12 13 14 |
# File 'lib/rubycc/rmake/model.rb', line 12 def flavor @flavor end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
12 13 14 |
# File 'lib/rubycc/rmake/model.rb', line 12 def value @value end |
Instance Method Details
#recursive? ⇒ Boolean
23 24 25 |
# File 'lib/rubycc/rmake/model.rb', line 23 def recursive? @flavor == :recursive end |
#simple? ⇒ Boolean
19 20 21 |
# File 'lib/rubycc/rmake/model.rb', line 19 def simple? @flavor == :simple end |