Class: CraftyClicks::Address
- Inherits:
-
Object
- Object
- CraftyClicks::Address
- Includes:
- ActiveModel::AttributeMethods, ActiveModel::Validations
- Defined in:
- lib/address.rb
Instance Attribute Summary collapse
-
#name_number ⇒ Object
Returns the value of attribute name_number.
-
#player ⇒ Object
Returns the value of attribute player.
-
#post_code ⇒ Object
Returns the value of attribute post_code.
-
#street ⇒ Object
Returns the value of attribute street.
-
#town_city ⇒ Object
Returns the value of attribute town_city.
Instance Method Summary collapse
-
#initialize(params) ⇒ Address
constructor
A new instance of Address.
- #to_s ⇒ Object
Constructor Details
#initialize(params) ⇒ Address
Returns a new instance of Address.
11 12 13 14 15 16 17 |
# File 'lib/address.rb', line 11 def initialize(params) params.each do |k, v| if respond_to?("#{k}=") send("#{k}=", v) end end end |
Instance Attribute Details
#name_number ⇒ Object
Returns the value of attribute name_number.
7 8 9 |
# File 'lib/address.rb', line 7 def name_number @name_number end |
#player ⇒ Object
Returns the value of attribute player.
7 8 9 |
# File 'lib/address.rb', line 7 def player @player end |
#post_code ⇒ Object
Returns the value of attribute post_code.
7 8 9 |
# File 'lib/address.rb', line 7 def post_code @post_code end |
#street ⇒ Object
Returns the value of attribute street.
7 8 9 |
# File 'lib/address.rb', line 7 def street @street end |
#town_city ⇒ Object
Returns the value of attribute town_city.
7 8 9 |
# File 'lib/address.rb', line 7 def town_city @town_city end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/address.rb', line 19 def to_s "#{self.name_number} #{self.street}, #{self.town_city}, #{self.post_code}" end |