Class: RubySky::Raw::Post

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysky/raw/post.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri:, cid:, commit:, validation_status:) ⇒ Post

Returns a new instance of Post.



14
15
16
17
18
19
# File 'lib/rubysky/raw/post.rb', line 14

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

Instance Attribute Details

#cidObject (readonly)

Returns the value of attribute cid.



12
13
14
# File 'lib/rubysky/raw/post.rb', line 12

def cid
  @cid
end

#commitObject (readonly)

Returns the value of attribute commit.



12
13
14
# File 'lib/rubysky/raw/post.rb', line 12

def commit
  @commit
end

#uriObject (readonly)

Returns the value of attribute uri.



12
13
14
# File 'lib/rubysky/raw/post.rb', line 12

def uri
  @uri
end

#validation_statusObject (readonly)

Returns the value of attribute validation_status.



12
13
14
# File 'lib/rubysky/raw/post.rb', line 12

def validation_status
  @validation_status
end

Class Method Details

.from_hash(hash) ⇒ Object



6
7
8
9
10
# File 'lib/rubysky/raw/post.rb', line 6

def self.from_hash(hash)
  allocate.tap do |this|
    this.update_by_hash hash
  end
end

Instance Method Details

#update_by_hash(hash) ⇒ Object



21
22
23
24
25
26
# File 'lib/rubysky/raw/post.rb', line 21

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