Class: WebPay::EventListRequest
- Defined in:
- lib/webpay/data_types.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#count ⇒ Object
attributes accessors.
- #count=(value) ⇒ Object
- #created ⇒ Object
- #created=(value) ⇒ Object
-
#initialize(hash = {}) ⇒ EventListRequest
constructor
A new instance of EventListRequest.
- #offset ⇒ Object
- #offset=(value) ⇒ Object
- #query_params ⇒ Object
- #request_body ⇒ Object
- #shop ⇒ Object
- #shop=(value) ⇒ Object
- #type ⇒ Object
- #type=(value) ⇒ Object
Methods inherited from Entity
Constructor Details
#initialize(hash = {}) ⇒ EventListRequest
Returns a new instance of EventListRequest.
1554 1555 1556 1557 1558 |
# File 'lib/webpay/data_types.rb', line 1554 def initialize(hash = {}) hash = normalize_hash(hash) hash['created'] = hash['created'].is_a?(Hash) ? WebPay::CreatedRange.new(hash['created']) : hash['created'] @attributes = hash end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
1537 1538 1539 |
# File 'lib/webpay/data_types.rb', line 1537 def attributes @attributes end |
Class Method Details
.create(params) ⇒ Object
1544 1545 1546 1547 1548 1549 1550 1551 1552 |
# File 'lib/webpay/data_types.rb', line 1544 def self.create(params) return params if params.is_a?(self) hash = case params when Hash; params else raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params) end self.new(hash) end |
.fields ⇒ Object
1539 1540 1541 |
# File 'lib/webpay/data_types.rb', line 1539 def self.fields ['count', 'offset', 'created', 'type', 'shop'] end |
Instance Method Details
#count ⇒ Object
attributes accessors
1578 1579 1580 |
# File 'lib/webpay/data_types.rb', line 1578 def count attributes['count'] end |
#count=(value) ⇒ Object
1582 1583 1584 |
# File 'lib/webpay/data_types.rb', line 1582 def count=(value) attributes['count'] = value end |
#created ⇒ Object
1594 1595 1596 |
# File 'lib/webpay/data_types.rb', line 1594 def created attributes['created'] end |
#created=(value) ⇒ Object
1598 1599 1600 1601 |
# File 'lib/webpay/data_types.rb', line 1598 def created=(value) value = value.is_a?(Hash) ? WebPay::CreatedRange.new(value) : value attributes['created'] = value end |
#offset ⇒ Object
1586 1587 1588 |
# File 'lib/webpay/data_types.rb', line 1586 def offset attributes['offset'] end |
#offset=(value) ⇒ Object
1590 1591 1592 |
# File 'lib/webpay/data_types.rb', line 1590 def offset=(value) attributes['offset'] = value end |
#query_params ⇒ Object
1566 1567 1568 1569 1570 1571 1572 1573 1574 |
# File 'lib/webpay/data_types.rb', line 1566 def query_params result = {} copy_if_exists(@attributes, result, 'count', 'query_params'); copy_if_exists(@attributes, result, 'offset', 'query_params'); copy_if_exists(@attributes, result, 'created', 'query_params'); copy_if_exists(@attributes, result, 'type', 'query_params'); copy_if_exists(@attributes, result, 'shop', 'query_params'); return result end |
#request_body ⇒ Object
1561 1562 1563 1564 |
# File 'lib/webpay/data_types.rb', line 1561 def request_body result = {} result end |
#shop ⇒ Object
1611 1612 1613 |
# File 'lib/webpay/data_types.rb', line 1611 def shop attributes['shop'] end |
#shop=(value) ⇒ Object
1615 1616 1617 |
# File 'lib/webpay/data_types.rb', line 1615 def shop=(value) attributes['shop'] = value end |
#type ⇒ Object
1603 1604 1605 |
# File 'lib/webpay/data_types.rb', line 1603 def type attributes['type'] end |
#type=(value) ⇒ Object
1607 1608 1609 |
# File 'lib/webpay/data_types.rb', line 1607 def type=(value) attributes['type'] = value end |