Class: XDry::IdVarType

Inherits:
VarType show all
Defined in:
lib/xdry/parsing/parts/var_types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from VarType

#needs_space?, parse, #to_source_with_space

Constructor Details

#initialize(protocol = nil) ⇒ IdVarType

Returns a new instance of IdVarType.



36
37
38
# File 'lib/xdry/parsing/parts/var_types.rb', line 36

def initialize protocol=nil
  @protocol = protocol
end

Instance Attribute Details

#protocolObject (readonly)

Returns the value of attribute protocol.



34
35
36
# File 'lib/xdry/parsing/parts/var_types.rb', line 34

def protocol
  @protocol
end

Instance Method Details

#default_property_retainment_policyObject



48
# File 'lib/xdry/parsing/parts/var_types.rb', line 48

def default_property_retainment_policy; 'assign'; end

#to_sObject



40
41
42
43
44
45
46
# File 'lib/xdry/parsing/parts/var_types.rb', line 40

def to_s
  if @protocol.nil?
    "id"
  else
    "id<#{@protocol}>"
  end
end