Class: AssLauncher::Support::V8iSection::Fields Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ass_launcher/support/v8i_section.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Class provaides case insensitive access to #_hash fields of AssLauncher::Support::V8iSection

Constant Summary collapse

REQUIRED =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

Define required fields of v8i

[:connect]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Fields

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Fields.

Parameters:

  • hash (Hash)

Raises:

  • (ArgumentError)

    if not all REQUIRED given



17
18
19
20
21
# File 'lib/ass_launcher/support/v8i_section.rb', line 17

def initialize(hash)
  @_hash = hash
  fail ArgumentError if\
    (REQUIRED - dict.keys).size > 0
end

Instance Attribute Details

#_hashHash (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns containe AssLauncher::Support::V8iSection fields.

Returns:



13
14
15
# File 'lib/ass_launcher/support/v8i_section.rb', line 13

def _hash
  @_hash
end

Instance Method Details

#[](key) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

:nodoc:



52
53
54
# File 'lib/ass_launcher/support/v8i_section.rb', line 52

def [](key)
  _hash[trans(key)]
end

#[]=(key, value) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

:nodoc:



57
58
59
# File 'lib/ass_launcher/support/v8i_section.rb', line 57

def []=(key, value)
  _hash[trans(key)] = value
end

#dictHash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Dictionary for case insensitive access to #_hash values

Returns:

  • (Hash)


25
26
27
# File 'lib/ass_launcher/support/v8i_section.rb', line 25

def dict
  @dict ||= build_dict
end

#key?(key) ⇒ Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

:nodoc:

Returns:

  • (Boolean)


62
63
64
# File 'lib/ass_launcher/support/v8i_section.rb', line 62

def key?(key)
  dict.key? key.to_s.downcase.to_sym
end

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

:nodoc:



67
68
69
70
71
72
73
# File 'lib/ass_launcher/support/v8i_section.rb', line 67

def to_s
  res = ''
  _hash.each do |key, value|
    res << "#{key}=#{value}\r\n"
  end
  res
end