Class: GoogleSheetsAppendroid::AppendRows

Inherits:
Object
  • Object
show all
Defined in:
lib/google_sheets_appendroid/append_rows.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rows, range) ⇒ AppendRows

Returns a new instance of AppendRows.



8
9
10
11
12
# File 'lib/google_sheets_appendroid/append_rows.rb', line 8

def initialize(rows, range)
  @access_token = Authorize.get_access_token
  @rows         = rows
  @range        = range
end

Instance Attribute Details

#access_tokenObject (readonly)

Returns the value of attribute access_token.



6
7
8
# File 'lib/google_sheets_appendroid/append_rows.rb', line 6

def access_token
  @access_token
end

#rangeObject (readonly)

Returns the value of attribute range.



6
7
8
# File 'lib/google_sheets_appendroid/append_rows.rb', line 6

def range
  @range
end

#rowsObject (readonly)

Returns the value of attribute rows.



6
7
8
# File 'lib/google_sheets_appendroid/append_rows.rb', line 6

def rows
  @rows
end

Instance Method Details

#punch_itObject



14
15
16
17
18
19
20
21
# File 'lib/google_sheets_appendroid/append_rows.rb', line 14

def punch_it
  req = create_request
  Net::HTTP.start(
    uri.hostname,
    uri.port,
    use_ssl: uri.scheme == 'https'
  ) { |http| http.request(req) } 
end