Class: Rubycc::Rmake::Variable

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#flavorObject (readonly)

Returns the value of attribute flavor.



12
13
14
# File 'lib/rubycc/rmake/model.rb', line 12

def flavor
  @flavor
end

#valueObject (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

Returns:

  • (Boolean)


23
24
25
# File 'lib/rubycc/rmake/model.rb', line 23

def recursive?
  @flavor == :recursive
end

#simple?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/rubycc/rmake/model.rb', line 19

def simple?
  @flavor == :simple
end