Class: Ykutils::YamlXOp

Inherits:
YamlOp
  • Object
show all
Includes:
DebugUtils
Defined in:
lib/ykutils/yamlxop.rb

Constant Summary

Constants inherited from YamlOp

Ykutils::YamlOp::TEST_ID_LISTUP_ALL, Ykutils::YamlOp::TEST_ID_NO_VALUE

Constants included from NKFUTIL

NKFUTIL::CODE_TO_NAME

Instance Attribute Summary collapse

Attributes inherited from YamlOp

#ofname, #valid

Instance Method Summary collapse

Methods included from DebugUtils

#clear_d, #d_caller, #d_exit, #d_p, #d_pp, #d_puts, #d_puts_no_empty, #debug_utils_init, #error_exit, #get_d, #get_debug, #get_warn, #puts_current_method, #puts_d, #puts_no_empty, #set_debug, #set_warn, #w1_puts, #w2_puts

Methods inherited from YamlOp

#dump_ptext_to_file, #dump_to_file, #exchange_ptext, #exec, #extract_value, #import, #importex, #listup_all, #listup_domain, #listup_host, #load_yaml, #load_yaml_ifname, #output_yaml, #reform, #sort, #test_listup, #update_yaml, #valid?

Methods included from DataStructOp

#exchange, #make_array, #make_hash, #select_array

Methods included from SpecFileOp

#check_data_complement, #check_data_complement_print_message, #dump_yaml_fileobj, #expand_data, #load_csv_file, #load_csv_file_ex, #load_plain_text_file, #load_yaml_file, #make_data_complement, #open_for_write, #parse_yaml_file, #save_yaml_file, #valid?

Methods included from NKFUTIL

assoc_equal, auto_config_from_inner, auto_config_to_inner, config, convert, get, guess_encoding, #nkf_utf8_file, #puts_sj, #puts_u, set

Constructor Details

#initialize(_opt, _args, debug) ⇒ YamlXOp

Returns a new instance of YamlXOp.



11
12
13
14
# File 'lib/ykutils/yamlxop.rb', line 11

def initialize(_opt, _args, debug)
  debug_utils_init
  set_debug(debug)
end

Instance Attribute Details

#yamlObject

Returns the value of attribute yaml.



7
8
9
# File 'lib/ykutils/yamlxop.rb', line 7

def yaml
  @yaml
end

Instance Method Details

#load(fname) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ykutils/yamlxop.rb', line 16

def load(fname)
  #    d_puts "3"
  #    puts_current_method

  #    d_puts "fname=#{fname}"
  @fname = fname
  #    @pstext = StructuredTextForX.new
  #    puts "fname=#{fname}"
  #    @pstext.load_analyze( fname )
  @yaml = load_yaml_file(fname)
end

#yaml2stextObject



28
29
30
31
32
33
# File 'lib/ykutils/yamlxop.rb', line 28

def yaml2stext
  yaml_str = YAML.dump(@yaml)
  yaml_ary = yaml_str.split("\n")
  @yamlstext = StructuredTextForAccount.new
  @yamlstext.analyze(yaml_ary)
end