Class: HaveAPI::Client::Parameters::Resource
- Inherits:
-
Object
- Object
- HaveAPI::Client::Parameters::Resource
- Defined in:
- lib/haveapi/client/parameters/resource.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
-
#initialize(params, desc, value) ⇒ Resource
constructor
A new instance of Resource.
- #to_api ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(params, desc, value) ⇒ Resource
Returns a new instance of Resource.
5 6 7 8 |
# File 'lib/haveapi/client/parameters/resource.rb', line 5 def initialize(params, desc, value) @errors = [] @value = coerce(value) end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
3 4 5 |
# File 'lib/haveapi/client/parameters/resource.rb', line 3 def errors @errors end |
Instance Method Details
#to_api ⇒ Object
14 15 16 |
# File 'lib/haveapi/client/parameters/resource.rb', line 14 def to_api @value end |
#valid? ⇒ Boolean
10 11 12 |
# File 'lib/haveapi/client/parameters/resource.rb', line 10 def valid? @errors.empty? end |