Sha256: 0757be519dc103eae1288712a527c6c42ead707d402d860a5121f3f54e9af357

Contents?: true

Size: 541 Bytes

Versions: 1

Compression:

Stored size: 541 Bytes

Contents

module Apstrings
  class KVPair
    attr_reader :line, :raw_comment

    def initialize(line, comment)
     @line = line
     @raw_comment = comment
    end

    def key
     line.key.strip unless line.key.nil?
    end

    def value
     line.value.strip unless line.key.nil? 
    end

    def comment
      if raw_comment.nil?
        @raw_comment = ""
      else
        raw_comment.gsub!(/(\/\*)|(\*\/)/,"")
        raw_comment.gsub!("\n", " ")
        raw_comment.gsub!(/\s+/, " ")
        raw_comment.strip
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
apstrings-0.3.6 lib/apstrings/kv_pair.rb