Module: Cplus2Ruby::Entity

Defined in:
lib/cplus2ruby/model.rb

Instance Method Summary collapse

Instance Method Details

#method(name, *args) ⇒ Object Also known as: method_c

method :name, hash, hash, …, hash, body, hash



156
157
158
159
# File 'lib/cplus2ruby/model.rb', line 156

def method(name, *args)
  options = parse_method_args(args)
  ann! name, Cplus2Ruby::Method, options 
end

#property(name, type = Object, options = {}) ⇒ Object

Raises:

  • (ArgumentError)


146
147
148
149
150
151
# File 'lib/cplus2ruby/model.rb', line 146

def property(name, type=Object, options={})
  raise ArgumentError if options[:type]
  options[:type] = type || Object
  options[:order] = Cplus2Ruby.model.next_prop_cnt 
  ann! name, Cplus2Ruby::Property, options
end

#static_method(name, *args) ⇒ Object



161
162
163
164
165
# File 'lib/cplus2ruby/model.rb', line 161

def static_method(name, *args)
  options = parse_method_args(args)
  options[:static] = true
  ann! name, Cplus2Ruby::Method, options 
end

#stub_method(name, *args) ⇒ Object



167
168
169
170
171
# File 'lib/cplus2ruby/model.rb', line 167

def stub_method(name, *args)
  options = parse_method_args(args)
  options[:stub] = true
  ann! name, Cplus2Ruby::Method, options 
end

#virtual(*virtuals) ⇒ Object



175
176
177
178
179
# File 'lib/cplus2ruby/model.rb', line 175

def virtual(*virtuals)
  virtuals.each do |name|
    ann! name, :virtual => true
  end
end