Class: PixxxerField
- Inherits:
-
Object
- Object
- PixxxerField
- Defined in:
- lib/pixxxer/field.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#precision ⇒ Object
readonly
Returns the value of attribute precision.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
- #and ⇒ Object
- #as_float ⇒ Object
- #as_integer ⇒ Object
- #as_string ⇒ Object
- #at_position(position) ⇒ Object
- #depixxxit(record) ⇒ Object
-
#initialize(field_name, template) ⇒ PixxxerField
constructor
A new instance of PixxxerField.
- #pixxxit(hash, record) ⇒ Object
- #with_precision(precision) ⇒ Object
- #with_width(width) ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/pixxxer/field.rb', line 5 def name @name end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
5 6 7 |
# File 'lib/pixxxer/field.rb', line 5 def position @position end |
#precision ⇒ Object (readonly)
Returns the value of attribute precision.
5 6 7 |
# File 'lib/pixxxer/field.rb', line 5 def precision @precision end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/pixxxer/field.rb', line 5 def type @type end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
5 6 7 |
# File 'lib/pixxxer/field.rb', line 5 def width @width end |
Instance Method Details
#and ⇒ Object
37 38 39 |
# File 'lib/pixxxer/field.rb', line 37 def and @template end |
#as_float ⇒ Object
29 30 31 32 |
# File 'lib/pixxxer/field.rb', line 29 def as_float @type = Float self end |
#as_integer ⇒ Object
25 26 27 28 |
# File 'lib/pixxxer/field.rb', line 25 def as_integer @type = Integer self end |
#as_string ⇒ Object
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 |