Class: CBS::Function
- Inherits:
-
Object
- Object
- CBS::Function
- Defined in:
- lib/cbs.rb
Instance Attribute Summary collapse
-
#arguments ⇒ Object
Returns the value of attribute arguments.
-
#block ⇒ Object
Returns the value of attribute block.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #format(first) ⇒ Object
-
#initialize(name, arguments, block) ⇒ Function
constructor
A new instance of Function.
Constructor Details
#initialize(name, arguments, block) ⇒ Function
Returns a new instance of Function.
215 216 217 |
# File 'lib/cbs.rb', line 215 def initialize(name, arguments, block) @name, @arguments, @block = name, arguments, block end |
Instance Attribute Details
#arguments ⇒ Object
Returns the value of attribute arguments.
214 215 216 |
# File 'lib/cbs.rb', line 214 def arguments @arguments end |
#block ⇒ Object
Returns the value of attribute block.
214 215 216 |
# File 'lib/cbs.rb', line 214 def block @block end |
#name ⇒ Object
Returns the value of attribute name.
214 215 216 |
# File 'lib/cbs.rb', line 214 def name @name end |
Instance Method Details
#format(first) ⇒ Object
218 219 220 221 222 223 |
# File 'lib/cbs.rb', line 218 def format(first) code = '' code += ',' unless first code += "\n" code += " #{name} : function#{arguments}#{block.gsub("\n ", "\n")}" end |