Class: PropertyType

Inherits:
Object
  • Object
show all
Defined in:
lib/metarecord/properties.rb

Direct Known Subclasses

Boolean, ByteArray, PropertyTypeFromRubyType

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ PropertyType

Returns a new instance of PropertyType.



2
3
4
# File 'lib/metarecord/properties.rb', line 2

def initialize name
  @name = name
end

Instance Method Details

#nameObject



6
7
8
# File 'lib/metarecord/properties.rb', line 6

def name
  @name
end

#parameter_type(options = {}) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/metarecord/properties.rb', line 10

def parameter_type options = {}
  if (pass_by_const_reference? && options[:ref].nil?) || options[:ref]
    "const #{@name}&"
  else
    @name
  end
end

#pass_by_const_reference?Boolean

Returns:



18
19
20
# File 'lib/metarecord/properties.rb', line 18

def pass_by_const_reference?
  true
end