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.



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

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.



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

def dtype
  @dtype
end

#macroObject (readonly)

Returns the value of attribute macro.



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

def macro
  @macro
end

#tmplObject (readonly)

Returns the value of attribute tmpl.



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

def tmpl
  @tmpl
end

#tpclassObject (readonly)

Returns the value of attribute tpclass.



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

def tpclass
  @tpclass
end

#tpnameObject (readonly)

Returns the value of attribute tpname.



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

def tpname
  @tpname
end

Class Method Details

.definitionsObject



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

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

Instance Method Details

#c_funcObject



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

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

#c_iterObject



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

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

#conditionObject



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

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

#definitionObject



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

def definition
  nil
end