Module: HaystackRuby::Types::DateTime

Defined in:
lib/haystack_ruby/types/date_time.rb

Instance Method Summary collapse

Instance Method Details

#set_fields(str_value) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/haystack_ruby/types/date_time.rb', line 4

def set_fields str_value
  @haystack_type = 'DateTime'
  match = /\At:(.*)\z/.match str_value
  begin
    @value = DateTime.parse match[1]
  rescue Exception=>e
    raise HaystackRuby::Error, "invalid HaystackRuby::Types::DateTime #{str_value}.  Error #{e}"
  end
end