Class: Pessimize::Declaration
- Inherits:
-
Object
- Object
- Pessimize::Declaration
- Defined in:
- lib/pessimize/declaration.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, *args) ⇒ Declaration
constructor
A new instance of Declaration.
- #to_code ⇒ Object
Constructor Details
#initialize(name, *args) ⇒ Declaration
Returns a new instance of Declaration.
5 6 7 8 |
# File 'lib/pessimize/declaration.rb', line 5 def initialize(name, *args) @name = name @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/pessimize/declaration.rb', line 3 def args @args end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/pessimize/declaration.rb', line 3 def name @name end |
Instance Method Details
#to_code ⇒ Object
10 11 12 13 14 15 |
# File 'lib/pessimize/declaration.rb', line 10 def to_code s = "" s << "#{name} " s << args.map(&:inspect).join(", ") s end |