Sha256: 7379cfd8b2f61a0f82b63a2c5755d54b09c0beaa9d247577706882a1425176ff

Contents?: true

Size: 416 Bytes

Versions: 7

Compression:

Stored size: 416 Bytes

Contents

module HaveAPI::Fs::Components
  class ActionStatus < File
    def initialize(action_dir, *args)
      super(*args)
      @action_dir = action_dir
      @v = nil
    end

    def read
      value.to_s + "\n"
    end

    def set(v)
      changed
      @v = v
    end

    protected
    def value
      case @v
      when true
        1

      when false
        0

      else
        nil
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
haveapi-fs-0.11.0 lib/haveapi/fs/components/action_status.rb
haveapi-fs-0.10.0 lib/haveapi/fs/components/action_status.rb
haveapi-fs-0.9.0 lib/haveapi/fs/components/action_status.rb
haveapi-fs-0.8.0 lib/haveapi/fs/components/action_status.rb
haveapi-fs-0.7.1 lib/haveapi/fs/components/action_status.rb
haveapi-fs-0.7.0 lib/haveapi/fs/components/action_status.rb
haveapi-fs-0.1.0 lib/haveapi/fs/components/action_status.rb