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

Inherits:
Object
  • Object
show all
Includes:
Module::ArgsNormalizer, 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.



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

def initialize( *args )
  args, options = normalize_args( 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.



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

def options
  @options
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

Class Method Details

.process(*args) ⇒ Object



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

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

Instance Method Details

#to_aArray

Returns:

  • (Array)


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

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