Module: HaystackRuby::Types::Bin

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

Instance Method Summary collapse

Instance Method Details

#set_fields(str_value) ⇒ Object



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

def set_fields str_value
  @haystack_type = 'Bin'
  match = /\Ab:(.*)\z/.match str_value
  raise HaystackRuby::Error, "invalid HaystackRuby::Types::Bin: #{str_value}" if match.nil?
  # Value is mime type
  @value = match[1]
end