Class: Baykit::BayServer::Docker::Base::ClubBase

Inherits:
DockerBase
  • Object
show all
Includes:
Bcf, Club, Util
Defined in:
lib/baykit/bayserver/docker/base/club_base.rb

Direct Known Subclasses

WarpBase, SendFile::SendFileDocker

Instance Attribute Summary collapse

Attributes inherited from DockerBase

#type

Instance Method Summary collapse

Methods included from Club

#arrive

Methods included from Docker

#type

Methods inherited from DockerBase

#init_docker

Constructor Details

#initializeClubBase

Returns a new instance of ClubBase.



22
23
24
25
26
27
28
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 22

def initialize
  @file_name = nil
  @extension = nil
  @charset = nil
  @locale = nil
  @decode_path_info = true
end

Instance Attribute Details

#charsetObject (readonly)

Returns the value of attribute charset.



18
19
20
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 18

def charset
  @charset
end

#decode_path_infoObject (readonly)

Returns the value of attribute decode_path_info.



20
21
22
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 20

def decode_path_info
  @decode_path_info
end

#extensionObject (readonly)

Returns the value of attribute extension.



17
18
19
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 17

def extension
  @extension
end

#file_nameObject (readonly)

Returns the value of attribute file_name.



16
17
18
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 16

def file_name
  @file_name
end

#localeObject (readonly)

Returns the value of attribute locale.



19
20
21
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 19

def locale
  @locale
end

Instance Method Details

#init(elm, parent) ⇒ Object

Implements Docker



38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 38

def init(elm, parent)
  super
  p = elm.arg.rindex('.');
  if(p == nil)
    @file_name = elm.arg
    @extension = nil
  else
    @file_name = elm.arg[0, p]
    @extension = elm.arg[p+1 .. -1]
  end

end

#init_key_val(kv) ⇒ Object

Implements DockerBase



55
56
57
58
59
60
61
62
63
64
65
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 55

def init_key_val(kv)
  case kv.key.downcase
  when "decodepathinfo"
    @decode_path_info = StringUtil.parse_bool(kv.value)
  when "charset"
    @charset = kv.value
  else
    return super
  end
  return true
end

#inspectObject



110
111
112
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 110

def inspect
  self.class.name
end

#matches(fname) ⇒ Object

Implements Club



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 71

def matches(fname)
  # check club
  pos = fname.index(".")
  if(pos == nil)
    # fname has no extension
    if(@extension != nil)
      return false
    end

    if(@file_name == "*")
      return true
    end

    return fname == @file_name
  else
    # fname has extension
    if(@extension == nil)
      return false
    end

    nm = fname[0, pos]
    ext = fname[pos + 1 .. -1]

    if(@extension != "*" && ext != @extension)
      return false
    end

    if(@file_name == "*")
      return true
    else
      return nm == @file_name
    end
  end
end

#to_sObject



30
31
32
# File 'lib/baykit/bayserver/docker/base/club_base.rb', line 30

def to_s()
  return ClassUtil.get_local_name(self.class)
end