Class: FacebookDialog::OptionSerialization

Inherits:
Object
  • Object
show all
Defined in:
lib/facebook_dialog/option_serialization.rb

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ OptionSerialization

Returns a new instance of OptionSerialization.



3
4
5
# File 'lib/facebook_dialog/option_serialization.rb', line 3

def initialize(options)
  @options = options
end

Instance Method Details

#serialized_hashObject



7
8
9
10
11
12
13
14
15
16
# File 'lib/facebook_dialog/option_serialization.rb', line 7

def serialized_hash
  @serialized_options = @options.dup
  options_to_serialize.each do |option_key|
    if @serialized_options[option_key] && @serialized_options[option_key].kind_of?(Array)
      @serialized_options[option_key] = @serialized_options[option_key].map{|i| i.to_s}.join(",")
    end
  end

  @serialized_options
end