Class: AbideDevUtils::Ppt::CodeIntrospection::Declaration
- Inherits:
-
Object
- Object
- AbideDevUtils::Ppt::CodeIntrospection::Declaration
- Includes:
- AbideDevUtils::Ppt::CodeGen::DataTypes
- Defined in:
- lib/abide_dev_utils/ppt/code_introspection.rb
Instance Attribute Summary collapse
-
#ast ⇒ Object
readonly
Returns the value of attribute ast.
Instance Method Summary collapse
-
#initialize(ast) ⇒ Declaration
constructor
A new instance of Declaration.
- #parameters ⇒ Object
- #parameters? ⇒ Boolean
Methods included from AbideDevUtils::Ppt::CodeGen::DataTypes
#display_type_expr, #display_type_expr_with_entries, #display_type_expr_with_left_expr, #display_value, #infer_data_type
Constructor Details
#initialize(ast) ⇒ Declaration
Returns a new instance of Declaration.
43 44 45 |
# File 'lib/abide_dev_utils/ppt/code_introspection.rb', line 43 def initialize(ast) @ast = ast.definitions.first end |
Instance Attribute Details
#ast ⇒ Object (readonly)
Returns the value of attribute ast.
41 42 43 |
# File 'lib/abide_dev_utils/ppt/code_introspection.rb', line 41 def ast @ast end |
Instance Method Details
#parameters ⇒ Object
51 52 53 54 55 |
# File 'lib/abide_dev_utils/ppt/code_introspection.rb', line 51 def parameters return unless parameters? @parameters ||= ast.parameters.map { |p| Parameter.new(p) } end |
#parameters? ⇒ Boolean
47 48 49 |
# File 'lib/abide_dev_utils/ppt/code_introspection.rb', line 47 def parameters? ast.respond_to? :parameters end |