Sha256: 59868604f707ac6c8c63af4fb3f1ad5ee0967961b0a85e32431fb74649cc7513

Contents?: true

Size: 330 Bytes

Versions: 1

Compression:

Stored size: 330 Bytes

Contents

module ParseP1

  class Base

    include ParseP1::Electricity
    include ParseP1::Gas

    attr_reader :data

    def initialize(data)
      @data = data
    end

    def valid?
      !data.match(/!$/).nil? && !device_id.nil?
    end

    def device_id
      data.match(/^\/([a-zA-Z]{3}\d{1}.+)\r$/)
      $1
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parse_p1-0.0.3 lib/parse_p1/base.rb