Class: Street
- Inherits:
-
Object
- Object
- Street
- Defined in:
- lib/street.rb
Instance Attribute Summary collapse
-
#area ⇒ Object
readonly
Returns the value of attribute area.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#postcode ⇒ Object
readonly
Returns the value of attribute postcode.
Instance Method Summary collapse
-
#initialize(params = nil) ⇒ Street
constructor
A new instance of Street.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(params = nil) ⇒ Street
Returns a new instance of Street.
6 7 8 |
# File 'lib/street.rb', line 6 def initialize params=nil parse_parameters(params) unless params.nil? end |
Instance Attribute Details
#area ⇒ Object (readonly)
Returns the value of attribute area.
4 5 6 |
# File 'lib/street.rb', line 4 def area @area end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/street.rb', line 4 def name @name end |
#postcode ⇒ Object (readonly)
Returns the value of attribute postcode.
4 5 6 |
# File 'lib/street.rb', line 4 def postcode @postcode end |
Instance Method Details
#to_hash ⇒ Object
14 15 16 |
# File 'lib/street.rb', line 14 def to_hash { :name => name, :postcode => postcode, :area => area } end |
#to_json ⇒ Object
10 11 12 |
# File 'lib/street.rb', line 10 def to_json to_hash.to_json end |