Class: PixxxerField

Inherits:
Object
  • Object
show all
Defined in:
lib/pixxxer/field.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(field_name, template) ⇒ PixxxerField

Returns a new instance of PixxxerField.



6
7
8
9
10
11
12
13
# File 'lib/pixxxer/field.rb', line 6

def initialize(field_name, template)
	@template = template
	@name = field_name
	@position = 0
	@precision = 0
	@pixxxitter = FieldPixxxitter.new self
	@depixxxitter = FieldDepixxxitter.new self
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/pixxxer/field.rb', line 5

def name
  @name
end

#positionObject (readonly)

Returns the value of attribute position.



5
6
7
# File 'lib/pixxxer/field.rb', line 5

def position
  @position
end

#precisionObject (readonly)

Returns the value of attribute precision.



5
6
7
# File 'lib/pixxxer/field.rb', line 5

def precision
  @precision
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/pixxxer/field.rb', line 5

def type
  @type
end

#widthObject (readonly)

Returns the value of attribute width.



5
6
7
# File 'lib/pixxxer/field.rb', line 5

def width
  @width
end

Instance Method Details

#andObject



37
38
39
# File 'lib/pixxxer/field.rb', line 37

def and
	@template
end

#as_floatObject



29
30
31
32
# File 'lib/pixxxer/field.rb', line 29

def as_float
	@type = Float
	self
end

#as_integerObject



25
26
27
28
# File 'lib/pixxxer/field.rb', line 25

def as_integer
	@type = Integer
	self
end

#as_stringObject



22
23
24
# File 'lib/pixxxer/field.rb', line 22

def as_string
	self
end

#at_position(position) ⇒ Object



18
19
20
21
# File 'lib/pixxxer/field.rb', line 18

def at_position(position)
	@position = position
	self
end

#depixxxit(record) ⇒ Object



43
44
45
# File 'lib/pixxxer/field.rb', line 43

def depixxxit(record)
	@depixxxitter.depixxxit record
end

#pixxxit(hash, record) ⇒ Object



40
41
42
# File 'lib/pixxxer/field.rb', line 40

def pixxxit(hash, record)
	@pixxxitter.pixxxit hash, record
end

#with_precision(precision) ⇒ Object



33
34
35
36
# File 'lib/pixxxer/field.rb', line 33

def with_precision(precision)
	@precision = precision
	self
end

#with_width(width) ⇒ Object



14
15
16
17
# File 'lib/pixxxer/field.rb', line 14

def with_width(width)
	@width = width
	self
end