Class: Copyleaks::ExportCrawledVersion
- Inherits:
-
Object
- Object
- Copyleaks::ExportCrawledVersion
- Defined in:
- lib/copyleaks/models/exports/export_crawled_version.rb
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#verb ⇒ Object
readonly
Returns the value of attribute verb.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(endpoint, verb, headers = nil) ⇒ ExportCrawledVersion
constructor
A new instance of ExportCrawledVersion.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(endpoint, verb, headers = nil) ⇒ ExportCrawledVersion
Returns a new instance of ExportCrawledVersion.
31 32 33 34 35 36 37 38 39 40 |
# File 'lib/copyleaks/models/exports/export_crawled_version.rb', line 31 def initialize(endpoint, verb, headers = nil) unless endpoint.instance_of?(String) raise 'Copyleaks::ExportCrawledVersion - endpoint - endpoint must be of type String' end raise 'Copyleaks::ExportCrawledVersion - verb - verb must be of type String' unless verb.instance_of?(String) @endpoint = endpoint @verb = verb @headers = headers end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
26 27 28 |
# File 'lib/copyleaks/models/exports/export_crawled_version.rb', line 26 def endpoint @endpoint end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
26 27 28 |
# File 'lib/copyleaks/models/exports/export_crawled_version.rb', line 26 def headers @headers end |
#verb ⇒ Object (readonly)
Returns the value of attribute verb.
26 27 28 |
# File 'lib/copyleaks/models/exports/export_crawled_version.rb', line 26 def verb @verb end |
Instance Method Details
#as_json(*_args) ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/copyleaks/models/exports/export_crawled_version.rb', line 42 def as_json(*_args) { endpoint: @endpoint, verb: @verb, headers: @headers }.select { |_k, v| !v.nil? } end |
#to_json(*options) ⇒ Object
50 51 52 |
# File 'lib/copyleaks/models/exports/export_crawled_version.rb', line 50 def to_json(*) as_json(*).to_json(*) end |