Class: Cry::Codegen::Interface

Inherits:
Object
  • Object
show all
Defined in:
lib/cry/codegen/interface.rb

Defined Under Namespace

Classes: Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, crystal_arg_types, crystal_ret_type) ⇒ Interface

Returns a new instance of Interface.



61
62
63
64
65
# File 'lib/cry/codegen/interface.rb', line 61

def initialize(name, crystal_arg_types, crystal_ret_type)
  @name = name
  @crystal_arg_types = crystal_arg_types.map { |t| Type.new(t) }
  @crystal_ret_type = Type.new(crystal_ret_type)
end

Instance Attribute Details

#crystal_arg_typesObject (readonly)

Returns the value of attribute crystal_arg_types.



59
60
61
# File 'lib/cry/codegen/interface.rb', line 59

def crystal_arg_types
  @crystal_arg_types
end

#crystal_ret_typeObject (readonly)

Returns the value of attribute crystal_ret_type.



59
60
61
# File 'lib/cry/codegen/interface.rb', line 59

def crystal_ret_type
  @crystal_ret_type
end

#nameObject (readonly)

Returns the value of attribute name.



59
60
61
# File 'lib/cry/codegen/interface.rb', line 59

def name
  @name
end