Class: ChicagoCrime::Crime

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Crime

Returns a new instance of Crime.



5
6
7
8
9
10
11
# File 'lib/chicago_crime/crime.rb', line 5

def initialize(hash)
  @case_number = hash["case_number"]
  @block = hash["block"]
  @primary_type = hash["primary_type"]
  @date = hash["date"]
  @community_area = hash["community_area"]
end

Instance Attribute Details

#blockObject

Returns the value of attribute block.



3
4
5
# File 'lib/chicago_crime/crime.rb', line 3

def block
  @block
end

#case_numberObject

Returns the value of attribute case_number.



3
4
5
# File 'lib/chicago_crime/crime.rb', line 3

def case_number
  @case_number
end

#community_areaObject

Returns the value of attribute community_area.



3
4
5
# File 'lib/chicago_crime/crime.rb', line 3

def community_area
  @community_area
end

#dateObject

Returns the value of attribute date.



3
4
5
# File 'lib/chicago_crime/crime.rb', line 3

def date
  @date
end

#primary_typeObject

Returns the value of attribute primary_type.



3
4
5
# File 'lib/chicago_crime/crime.rb', line 3

def primary_type
  @primary_type
end