Class: CraftyClicks::Address

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::AttributeMethods, ActiveModel::Validations
Defined in:
lib/address.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_numberObject

Returns the value of attribute name_number.



7
8
9
# File 'lib/address.rb', line 7

def name_number
  @name_number
end

#playerObject

Returns the value of attribute player.



7
8
9
# File 'lib/address.rb', line 7

def player
  @player
end

#post_codeObject

Returns the value of attribute post_code.



7
8
9
# File 'lib/address.rb', line 7

def post_code
  @post_code
end

#streetObject

Returns the value of attribute street.



7
8
9
# File 'lib/address.rb', line 7

def street
  @street
end

#town_cityObject

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_sObject



19
20
21
# File 'lib/address.rb', line 19

def to_s
  "#{self.name_number} #{self.street}, #{self.town_city}, #{self.post_code}"
end