Class: FancyHands::Custom
- Inherits:
-
Object
- Object
- FancyHands::Custom
- Defined in:
- lib/fancyhands/v1/custom.rb
Instance Method Summary collapse
- #get(key = "", status = "", cursor = "") ⇒ Object
-
#initialize(client) ⇒ Custom
constructor
A new instance of Custom.
- #post(title = "", description = "", bid = 0.0, expiration_date = nil, custom_fields = {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Custom
Returns a new instance of Custom.
5 6 7 |
# File 'lib/fancyhands/v1/custom.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/custom.rb', line 23 def get(key="", status="", cursor="") data = { :key => key, :status => status, :cursor => cursor } return @client.request.get("request/custom", data) end |
#post(title = "", description = "", bid = 0.0, expiration_date = nil, custom_fields = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fancyhands/v1/custom.rb', line 9 def post(title="", description="", bid=0.0, expiration_date=nil, custom_fields={}) 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"), :custom_fields => custom_fields, } return @client.request.post("request/custom", data) end |