Class: RepoTender::State::Store::Repo

Inherits:
Data
  • Object
show all
Defined in:
lib/repo_tender/state/store.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(default_branch: nil, last_fetch_at: nil, last_synced_at: nil, status: nil, last_error: nil) ⇒ Repo

Returns a new instance of Repo.



20
21
22
# File 'lib/repo_tender/state/store.rb', line 20

def initialize(default_branch: nil, last_fetch_at: nil, last_synced_at: nil, status: nil, last_error: nil)
  super
end

Instance Attribute Details

#default_branchObject (readonly)

Returns the value of attribute default_branch

Returns:

  • (Object)

    the current value of default_branch



19
20
21
# File 'lib/repo_tender/state/store.rb', line 19

def default_branch
  @default_branch
end

#last_errorObject (readonly)

Returns the value of attribute last_error

Returns:

  • (Object)

    the current value of last_error



19
20
21
# File 'lib/repo_tender/state/store.rb', line 19

def last_error
  @last_error
end

#last_fetch_atObject (readonly)

Returns the value of attribute last_fetch_at

Returns:

  • (Object)

    the current value of last_fetch_at



19
20
21
# File 'lib/repo_tender/state/store.rb', line 19

def last_fetch_at
  @last_fetch_at
end

#last_synced_atObject (readonly)

Returns the value of attribute last_synced_at

Returns:

  • (Object)

    the current value of last_synced_at



19
20
21
# File 'lib/repo_tender/state/store.rb', line 19

def last_synced_at
  @last_synced_at
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



19
20
21
# File 'lib/repo_tender/state/store.rb', line 19

def status
  @status
end

Instance Method Details

#to_h_compactObject



24
25
26
27
28
29
30
31
32
# File 'lib/repo_tender/state/store.rb', line 24

def to_h_compact
  {
    "default_branch" => default_branch,
    "last_fetch_at" => format_time(last_fetch_at),
    "last_synced_at" => format_time(last_synced_at),
    "status" => status,
    "last_error" => last_error
  }.compact
end