Class: CrimeCrimeChicago::Crime
- Inherits:
-
Object
- Object
- CrimeCrimeChicago::Crime
- Defined in:
- lib/crime_crime_chicago.rb
Instance Attribute Summary collapse
-
#arrest ⇒ Object
readonly
Returns the value of attribute arrest.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#primary_type ⇒ Object
readonly
Returns the value of attribute primary_type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ Crime
constructor
A new instance of Crime.
Constructor Details
#initialize(hash) ⇒ Crime
Returns a new instance of Crime.
8 9 10 11 12 13 14 |
# File 'lib/crime_crime_chicago.rb', line 8 def initialize(hash) @id = hash["id"] @date = hash["date"] @primary_type = hash["primary_type"] @description = hash["description"] @arrest = hash["arrest"] end |
Instance Attribute Details
#arrest ⇒ Object (readonly)
Returns the value of attribute arrest.
6 7 8 |
# File 'lib/crime_crime_chicago.rb', line 6 def arrest @arrest end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
6 7 8 |
# File 'lib/crime_crime_chicago.rb', line 6 def date @date end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6 7 8 |
# File 'lib/crime_crime_chicago.rb', line 6 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/crime_crime_chicago.rb', line 6 def id @id end |
#primary_type ⇒ Object (readonly)
Returns the value of attribute primary_type.
6 7 8 |
# File 'lib/crime_crime_chicago.rb', line 6 def primary_type @primary_type end |