Class: Street

Inherits:
Object
  • Object
show all
Defined in:
lib/street.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#areaObject (readonly)

Returns the value of attribute area.



4
5
6
# File 'lib/street.rb', line 4

def area
  @area
end

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/street.rb', line 4

def name
  @name
end

#postcodeObject (readonly)

Returns the value of attribute postcode.



4
5
6
# File 'lib/street.rb', line 4

def postcode
  @postcode
end

Instance Method Details

#to_hashObject



14
15
16
# File 'lib/street.rb', line 14

def to_hash
  { :name => name, :postcode => postcode, :area => area }
end

#to_jsonObject



10
11
12
# File 'lib/street.rb', line 10

def to_json
  to_hash.to_json
end