Class: CoPilot::BuildTableRow

Inherits:
Object
  • Object
show all
Defined in:
lib/copilot/requests/internal/build_table_row.rb

Instance Method Summary collapse

Constructor Details

#initialize(tr) ⇒ BuildTableRow

Returns a new instance of BuildTableRow.



6
7
8
# File 'lib/copilot/requests/internal/build_table_row.rb', line 6

def initialize(tr)
  @tr = tr
end

Instance Method Details

#added_dateObject



18
19
20
# File 'lib/copilot/requests/internal/build_table_row.rb', line 18

def added_date
  Time.parse @tr[2].text
end

#build_idObject



10
11
12
# File 'lib/copilot/requests/internal/build_table_row.rb', line 10

def build_id
  @tr.id.split('/').last
end

#built_forObject



22
23
24
# File 'lib/copilot/requests/internal/build_table_row.rb', line 22

def built_for
  @tr[3].text
end

#crashesObject



34
35
36
# File 'lib/copilot/requests/internal/build_table_row.rb', line 34

def crashes
  @tr[6].text.to_i
end

#feedbackObject



38
39
40
# File 'lib/copilot/requests/internal/build_table_row.rb', line 38

def feedback
  @tr[7].text.to_i
end

#installsObject



42
43
44
# File 'lib/copilot/requests/internal/build_table_row.rb', line 42

def installs
  @tr[8].text.to_i
end

#sdkObject



30
31
32
# File 'lib/copilot/requests/internal/build_table_row.rb', line 30

def sdk
  @tr[5].text
end

#sizeObject



26
27
28
# File 'lib/copilot/requests/internal/build_table_row.rb', line 26

def size
  @tr[4].text
end

#to_hashObject



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/copilot/requests/internal/build_table_row.rb', line 46

def to_hash
  {
      id: build_id,
      version: version,
      added_date: added_date,
      built_for: built_for,
      size: size,
      sdk: sdk,
      crashes: crashes,
      feedback: feedback,
      installs: installs
  }
end

#versionObject



14
15
16
# File 'lib/copilot/requests/internal/build_table_row.rb', line 14

def version
  @tr[1].text
end