Class: Store

Inherits:
Function show all
Defined in:
lib/erbpp/narray_def.rb

Overview


Direct Known Subclasses

StoreArray, StoreNum

Constant Summary collapse

DEFS =
[]

Constants inherited from ErbPP

ErbPP::ATTRS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Function

#c_method, #code, codes, #id_op, #method, #op_map

Methods inherited from ErbPP

#attr_method, #attrs, #check_params, define_attrs, #has_attr?, #load_erb, #method_missing, #method_missing_alias, #parents, #result, #run, #search_method_in_parents

Constructor Details

#initialize(parent, tmpl, tpname, dtype, tpclass, macro) ⇒ Store

Returns a new instance of Store.



279
280
281
282
283
284
285
286
# File 'lib/erbpp/narray_def.rb', line 279

def initialize(parent,tmpl,tpname,dtype,tpclass,macro)
  super(parent,tmpl)
  @tpname=tpname
  @dtype=dtype
  @tpclass=tpclass
  @macro=macro
  DEFS.push(self)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ErbPP

Instance Attribute Details

#dtypeObject (readonly)

Returns the value of attribute dtype.



287
288
289
# File 'lib/erbpp/narray_def.rb', line 287

def dtype
  @dtype
end

#macroObject (readonly)

Returns the value of attribute macro.



287
288
289
# File 'lib/erbpp/narray_def.rb', line 287

def macro
  @macro
end

#tmplObject (readonly)

Returns the value of attribute tmpl.



287
288
289
# File 'lib/erbpp/narray_def.rb', line 287

def tmpl
  @tmpl
end

#tpclassObject (readonly)

Returns the value of attribute tpclass.



287
288
289
# File 'lib/erbpp/narray_def.rb', line 287

def tpclass
  @tpclass
end

#tpnameObject (readonly)

Returns the value of attribute tpname.



287
288
289
# File 'lib/erbpp/narray_def.rb', line 287

def tpname
  @tpname
end

Class Method Details

.definitionsObject



305
306
307
308
309
310
311
# File 'lib/erbpp/narray_def.rb', line 305

def self.definitions
  a = []
  DEFS.each do |i|
    a.push(i) if i.condition
  end
  a
end

Instance Method Details

#c_funcObject



289
290
291
# File 'lib/erbpp/narray_def.rb', line 289

def c_func
  "numo_#{tp}_store_#{tpname}"
end

#c_iterObject



293
294
295
# File 'lib/erbpp/narray_def.rb', line 293

def c_iter
  "iter_#{tp}_store_#{tpname}"
end

#conditionObject



301
302
303
# File 'lib/erbpp/narray_def.rb', line 301

def condition
  "rb_obj_is_kind_of(obj,#{tpclass})"
end

#definitionObject



297
298
299
# File 'lib/erbpp/narray_def.rb', line 297

def definition
  nil
end