Class: Esa::Matome::Today::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/esa/matome/today/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token: nil, api_endpoint: nil, current_team: nil, today: Date.today) ⇒ Client

Returns a new instance of Client.



7
8
9
10
# File 'lib/esa/matome/today/client.rb', line 7

def initialize(access_token: nil, api_endpoint: nil, current_team: nil, today: Date.today)
  @today = today.strftime('%Y-%m-%d')
  @esa_client = Esa::Client.new(access_token: access_token, api_endpoint: api_endpoint, current_team: current_team)
end

Instance Attribute Details

#esa_clientObject (readonly)

Returns the value of attribute esa_client.



5
6
7
# File 'lib/esa/matome/today/client.rb', line 5

def esa_client
  @esa_client
end

#todayObject (readonly)

Returns the value of attribute today.



5
6
7
# File 'lib/esa/matome/today/client.rb', line 5

def today
  @today
end

Instance Method Details

#posts(params = nil, headers = nil) ⇒ Object



12
13
14
# File 'lib/esa/matome/today/client.rb', line 12

def posts(params = nil, headers = nil)
  @esa_client.posts(Esa::Matome::Today::Param.new(params: params, today: @today).to_hash, headers)
end