Class: Spree::Address::Name
- Inherits:
-
Object
- Object
- Spree::Address::Name
- Defined in:
- app/models/spree/address/name.rb
Overview
Provides a value object to help splitting and joining name fields
Instance Attribute Summary collapse
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(*components) ⇒ Name
constructor
A new instance of Name.
- #to_s ⇒ Object
Constructor Details
#initialize(*components) ⇒ Name
Returns a new instance of Name.
10 11 12 13 |
# File 'app/models/spree/address/name.rb', line 10 def initialize(*components) @value = components.join(' ').strip initialize_name_components(components) end |
Instance Attribute Details
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
8 9 10 |
# File 'app/models/spree/address/name.rb', line 8 def first_name @first_name end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
8 9 10 |
# File 'app/models/spree/address/name.rb', line 8 def last_name @last_name end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
8 9 10 |
# File 'app/models/spree/address/name.rb', line 8 def value @value end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'app/models/spree/address/name.rb', line 15 def to_s @value end |