Class: OldBill::V2::CrimeByMonth

Inherits:
Hashie::Trash
  • Object
show all
Defined in:
lib/oldbill/v2/crime_by_month.rb

Class Method Summary collapse

Class Method Details

.property(property_name, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/oldbill/v2/crime_by_month.rb', line 5

def self.property(property_name, options = {})
  if options[:from] && options[:from] =~ /-/
    translations << options[:from].to_sym
    define_method "#{options[:from]}=" do |val|
      self[:"#{property_name}"] = val
    end
    options.delete(:from)
    super(property_name, options)
  else
    super
  end
end