# File text/format.rb, line 943 943: def initialize(arg = nil, &block) 944: case arg 945: when Text::Format 946: __create(arg.text) do 947: @columns = arg.columns 948: @tabstop = arg.tabstop 949: @first_indent = arg.first_indent 950: @body_indent = arg.body_indent 951: @format_style = arg.format_style 952: @left_margin = arg.left_margin 953: @right_margin = arg.right_margin 954: @extra_space = arg.extra_space 955: @tag_paragraph = arg.tag_paragraph 956: @tag_text = arg.tag_text 957: @abbreviations = arg.abbreviations 958: @nobreak = arg.nobreak 959: @nobreak_regex = arg.nobreak_regex 960: @text = arg.text 961: @hard_margins = arg.hard_margins 962: @split_words = arg.split_words 963: @split_rules = arg.split_rules 964: @hyphenator = arg.hyphenator 965: end 966: instance_eval(&block) unless block.nil? 967: when Hash 968: __create do 969: @columns = arg[:columns] || arg['columns'] || @columns 970: @tabstop = arg[:tabstop] || arg['tabstop'] || @tabstop 971: @first_indent = arg[:first_indent] || arg['first_indent'] || @first_indent 972: @body_indent = arg[:body_indent] || arg['body_indent'] || @body_indent 973: @format_style = arg[:format_style] || arg['format_style'] || @format_style 974: @left_margin = arg[:left_margin] || arg['left_margin'] || @left_margin 975: @right_margin = arg[:right_margin] || arg['right_margin'] || @right_margin 976: @extra_space = arg[:extra_space] || arg['extra_space'] || @extra_space 977: @text = arg[:text] || arg['text'] || @text 978: @tag_paragraph = arg[:tag_paragraph] || arg['tag_paragraph'] || @tag_paragraph 979: @tag_text = arg[:tag_text] || arg['tag_text'] || @tag_text 980: @abbreviations = arg[:abbreviations] || arg['abbreviations'] || @abbreviations 981: @nobreak = arg[:nobreak] || arg['nobreak'] || @nobreak 982: @nobreak_regex = arg[:nobreak_regex] || arg['nobreak_regex'] || @nobreak_regex 983: @hard_margins = arg[:hard_margins] || arg['hard_margins'] || @hard_margins 984: @split_rules = arg[:split_rules] || arg['split_rules'] || @split_rules 985: @hyphenator = arg[:hyphenator] || arg['hyphenator'] || @hyphenator 986: end 987: instance_eval(&block) unless block.nil? 988: when String 989: __create(arg, &block) 990: when NilClass 991: __create(&block) 992: else 993: raise TypeError 994: end 995: end