Sha256: 312949601a23e5d5093c0d7d37f3dd94114fb928113f09b53c03e5e2a6cf12a2

Contents?: true

Size: 540 Bytes

Versions: 14

Compression:

Stored size: 540 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

14 entries across 14 versions & 1 rubygems

Version Path
apstrings-0.3.5 lib/apstrings/kv_pair.rb
apstrings-0.3.4 lib/apstrings/kv_pair.rb
apstrings-0.3.3 lib/apstrings/kv_pair.rb
apstrings-0.3.1 lib/apstrings/kv_pair.rb
apstrings-0.3.0 lib/apstrings/kv_pair.rb
apstrings-0.2.7 lib/apstrings/kv_pair.rb
apstrings-0.2.6 lib/apstrings/kv_pair.rb
apstrings-0.2.5 lib/apstrings/kv_pair.rb
apstrings-0.2.4 lib/apstrings/kv_pair.rb
apstrings-0.2.2 lib/apstrings/kv_pair.rb
apstrings-0.2.1 lib/apstrings/kv_pair.rb
apstrings-0.2.0 lib/apstrings/kv_pair.rb
apstrings-0.1.1 lib/apstrings/kv_pair.rb
apstrings-0.1.0 lib/apstrings/kv_pair.rb