Sha256: 902168ad04709f288578756e2a30a1a4e3315183dd8fa85c5767b222c8435156

Contents?: true

Size: 646 Bytes

Versions: 5

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

module RubySky
  module Raw
    class Post # :nodoc:
      def self.from_hash(hash)
        allocate.tap do |this|
          this.update_by_hash hash
        end
      end

      attr_reader :uri, :cid, :commit, :validation_status

      def initialize(uri:, cid:, commit:, validation_status:)
        @uri = uri
        @cid = cid
        @commit = commit
        @validation_status = validation_status
      end

      def update_by_hash(hash)
        @uri = hash["uri"]
        @cid = hash["cid"]
        @commit = hash["commit"]
        @validation_status = hash["validationStatus"]
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
rubysky-0.5.0 lib/rubysky/raw/post.rb
rubysky-0.4.0 lib/rubysky/raw/post.rb
rubysky-0.3.0 lib/rubysky/raw/post.rb
rubysky-0.2.1 lib/rubysky/raw/post.rb
rubysky-0.2.0 lib/rubysky/raw/post.rb