Sha256: c017adbbccc36c128c6c7e1ed460a7f823649e8e30466f9211f80c335a98d2e9

Contents?: true

Size: 818 Bytes

Versions: 3

Compression:

Stored size: 818 Bytes

Contents

class RestModel
  module Configuration
    extend self

    attr_accessor :host

    DefaultHandler = proc {|keys| keys}

    def configure
      yield self if block_given?
    end

    def convert_input_keys
      @convert_input_keys || DefaultHandler
    end

    def convert_input_keys=(converter)
      @convert_input_keys = converter
    end

    def true_value
      @true || true
    end

    def true_value=(value)
      @true = value
    end

    def false_value
      @false || false
    end

    def false_value=(value)
      @false = value
    end

    def date_format
      @date_format
    end

    def date_format=(format)
      @date_format = format
    end

    def date_time_format
      @date_time_format
    end

    def date_time_format=(format)
      @date_time_format = format
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rest_model-0.3.1 lib/rest_model/configuration.rb
rest_model-0.3.0 lib/rest_model/configuration.rb
rest_model-0.2.3 lib/rest_model/configuration.rb