Class: FancyHands::Standard
- Inherits:
-
Object
- Object
- FancyHands::Standard
- Defined in:
- lib/fancyhands/v1/standard.rb
Instance Method Summary collapse
- #get(key = "", status = "", cursor = "") ⇒ Object
-
#initialize(client) ⇒ Standard
constructor
A new instance of Standard.
- #post(title = "", description = "", bid = 0.0, expiration_date = nil) ⇒ Object
Constructor Details
#initialize(client) ⇒ Standard
Returns a new instance of Standard.
5 6 7 |
# File 'lib/fancyhands/v1/standard.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#get(key = "", status = "", cursor = "") ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/fancyhands/v1/standard.rb', line 23 def get(key="", status="", cursor="") data = { :key => key, :status => status, :cursor => cursor } return @client.request.get("request/standard", data) end |
#post(title = "", description = "", bid = 0.0, expiration_date = nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/fancyhands/v1/standard.rb', line 9 def post(title="", description="", bid=0.0, expiration_date=nil) if !expiration_date expiration_date = DateTime.now + 1 end data = { :title => title, :description => description, :bid => bid, :expiration_date => expiration_date.strftime("%Y-%m-%dT%H:%M:%SZ"), } return @client.request.post("request/standard", data) end |