Class: Baykit::BayServer::Bcf::BcfElement

Inherits:
BcfObject
  • Object
show all
Defined in:
lib/baykit/bayserver/bcf/bcf_element.rb

Instance Attribute Summary collapse

Attributes inherited from BcfObject

#file_name, #line_no

Instance Method Summary collapse

Constructor Details

#initialize(name, arg, file_name, line_no) ⇒ BcfElement

Returns a new instance of BcfElement.



12
13
14
15
16
17
# File 'lib/baykit/bayserver/bcf/bcf_element.rb', line 12

def initialize(name, arg, file_name, line_no)
  super file_name, line_no
  @name = name
  @arg = arg
  @content_list = []
end

Instance Attribute Details

#argObject (readonly)

Returns the value of attribute arg.



9
10
11
# File 'lib/baykit/bayserver/bcf/bcf_element.rb', line 9

def arg
  @arg
end

#content_listObject (readonly)

Returns the value of attribute content_list.



10
11
12
# File 'lib/baykit/bayserver/bcf/bcf_element.rb', line 10

def content_list
  @content_list
end

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/baykit/bayserver/bcf/bcf_element.rb', line 8

def name
  @name
end

Instance Method Details

#get_value(key) ⇒ Object



19
20
21
22
23
24
25
26
# File 'lib/baykit/bayserver/bcf/bcf_element.rb', line 19

def get_value(key)
  content_list.each do |o|
    if o.instance_of?(BcfKeyVal) && o.key.casecmp?(key)
      return o.value
    end
  end
  nil
end