Class: ChicagoCrime::Crime
- Inherits:
-
Object
- Object
- ChicagoCrime::Crime
- Defined in:
- lib/chicago_crime/crime.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#case_number ⇒ Object
Returns the value of attribute case_number.
-
#community_area ⇒ Object
Returns the value of attribute community_area.
-
#date ⇒ Object
Returns the value of attribute date.
-
#primary_type ⇒ Object
Returns the value of attribute primary_type.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Crime
constructor
A new instance of Crime.
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
#block ⇒ Object
Returns the value of attribute block.
3 4 5 |
# File 'lib/chicago_crime/crime.rb', line 3 def block @block end |
#case_number ⇒ Object
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_area ⇒ Object
Returns the value of attribute community_area.
3 4 5 |
# File 'lib/chicago_crime/crime.rb', line 3 def community_area @community_area end |
#date ⇒ Object
Returns the value of attribute date.
3 4 5 |
# File 'lib/chicago_crime/crime.rb', line 3 def date @date end |
#primary_type ⇒ Object
Returns the value of attribute primary_type.
3 4 5 |
# File 'lib/chicago_crime/crime.rb', line 3 def primary_type @primary_type end |