Class: Nard::Appi::Client::Util::BaseNormalizer

Inherits:
Object
  • Object
show all
Includes:
Module::BooleanNormalizer, Module::OptionsNormalizer, Module::PathNormalizer
Defined in:
lib/nard/appi/client/util/base_normalizer.rb

Overview

API へ送る情報を処理するクラス(基底クラス)

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ BaseNormalizer

Returns a new instance of BaseNormalizer.



26
27
28
29
30
31
32
33
34
35
# File 'lib/nard/appi/client/util/base_normalizer.rb', line 26

def initialize( *args )
  args, options = ArgsNormalizer.execute( *args )

  @path = normalize_path( args )

  options = normalize_keys_of_options( options )
  set_special_options( options )

  @options = normalize_values_of_options( options )
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



37
38
39
# File 'lib/nard/appi/client/util/base_normalizer.rb', line 37

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path.



37
38
39
# File 'lib/nard/appi/client/util/base_normalizer.rb', line 37

def path
  @path
end

Class Method Details

.process(*args) ⇒ Object



22
23
24
# File 'lib/nard/appi/client/util/base_normalizer.rb', line 22

def self.process( *args )
  new( *args ).to_a
end

Instance Method Details

#to_aArray

Returns:

  • (Array)


40
41
42
# File 'lib/nard/appi/client/util/base_normalizer.rb', line 40

def to_a
  [ @path, @options, special_options ].flatten
end