Class: Billing::Field
- Inherits:
-
Object
- Object
- Billing::Field
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/billing/field.rb
Overview
represents a field in a row in BIF file
Instance Attribute Summary collapse
-
#constant_value ⇒ Object
Returns the value of attribute constant_value.
-
#dynamic_attribute ⇒ Object
Returns the value of attribute dynamic_attribute.
-
#name ⇒ Object
Returns the value of attribute name.
-
#number_of_spaces ⇒ Object
Returns the value of attribute number_of_spaces.
-
#order ⇒ Object
Returns the value of attribute order.
-
#position_from ⇒ Object
Returns the value of attribute position_from.
-
#position_to ⇒ Object
Returns the value of attribute position_to.
-
#right_justified ⇒ Object
Returns the value of attribute right_justified.
Instance Method Summary collapse
Instance Attribute Details
#constant_value ⇒ Object
Returns the value of attribute constant_value
5 6 7 |
# File 'app/models/billing/field.rb', line 5 def constant_value @constant_value end |
#dynamic_attribute ⇒ Object
Returns the value of attribute dynamic_attribute
5 6 7 |
# File 'app/models/billing/field.rb', line 5 def dynamic_attribute @dynamic_attribute end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'app/models/billing/field.rb', line 5 def name @name end |
#number_of_spaces ⇒ Object
Returns the value of attribute number_of_spaces
5 6 7 |
# File 'app/models/billing/field.rb', line 5 def number_of_spaces @number_of_spaces end |
#order ⇒ Object
Returns the value of attribute order
5 6 7 |
# File 'app/models/billing/field.rb', line 5 def order @order end |
#position_from ⇒ Object
Returns the value of attribute position_from
5 6 7 |
# File 'app/models/billing/field.rb', line 5 def position_from @position_from end |
#position_to ⇒ Object
Returns the value of attribute position_to
5 6 7 |
# File 'app/models/billing/field.rb', line 5 def position_to @position_to end |
#right_justified ⇒ Object
Returns the value of attribute right_justified
5 6 7 |
# File 'app/models/billing/field.rb', line 5 def right_justified @right_justified end |
Instance Method Details
#alignment ⇒ Object
13 14 15 |
# File 'app/models/billing/field.rb', line 13 def alignment right_justified ? :rjust : :ljust end |
#length ⇒ Object
9 10 11 |
# File 'app/models/billing/field.rb', line 9 def length position_to - position_from + 1 end |
#value(billing_item = nil) ⇒ Object
17 18 19 |
# File 'app/models/billing/field.rb', line 17 def value(billing_item = nil) constant_value || billing_item.send(dynamic_attribute) end |