Class: OldBill::V2::Neighbourhoods::Event

Inherits:
Hashie::Dash
  • Object
show all
Defined in:
lib/oldbill/v2/neighbourhoods/event.rb

Instance Method Summary collapse

Instance Method Details

#[]=(property, value) ⇒ Object

yak!!!!! refactor me please



29
30
31
32
33
34
35
36
37
38
# File 'lib/oldbill/v2/neighbourhoods/event.rb', line 29

def []=(property, value)
  case property 
    when "contact_details"
    super(property.to_s, contact_details_parsed(value))
    when "start_date"
    super(property.to_s, start_date_parsed(value))
  else
    super
  end
end

#contact_details_parsed(value) ⇒ Object

email telephone



16
17
18
19
20
# File 'lib/oldbill/v2/neighbourhoods/event.rb', line 16

def contact_details_parsed(value)
  unless value.nil?
    Hashie::Mash.new(value)
  end
end

#start_date_parsed(value) ⇒ Object



22
23
24
25
26
# File 'lib/oldbill/v2/neighbourhoods/event.rb', line 22

def start_date_parsed(value)
  unless value.nil?
    Date.parse(value)
  end
end