Class: Fugle::Intraday::Trades Private

Inherits:
Object
  • Object
show all
Includes:
Enumerable, HTTP::API
Defined in:
lib/fugle/intraday/trades.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The Intraday Trades

Since:

  • 0.1.0

Constant Summary

Constants included from HTTP::API

HTTP::API::ENDPOINT, HTTP::API::VERSION

Instance Method Summary collapse

Methods included from HTTP::API

included

Constructor Details

#initialize(items) ⇒ Trades

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Trades.

Since:

  • 0.1.0



20
21
22
# File 'lib/fugle/intraday/trades.rb', line 20

def initialize(items)
  @items = items.map { |item| Trade.new(item) }
end

Instance Method Details

#each(&block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0



26
27
28
# File 'lib/fugle/intraday/trades.rb', line 26

def each(&block)
  @items.each(&block)
end

#to_json(*args) ⇒ String

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Convert to JSON

Returns:

  • (String)

    the json string

Since:

  • 0.1.0



36
37
38
# File 'lib/fugle/intraday/trades.rb', line 36

def to_json(*args)
  to_a.to_json(*args)
end