Class: Finlight::Source

Inherits:
Object
  • Object
show all
Defined in:
lib/finlight/models.rb

Overview

A news source available through the API.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain:, is_content_available:, is_default_source:) ⇒ Source

Returns a new instance of Source.



175
176
177
178
179
# File 'lib/finlight/models.rb', line 175

def initialize(domain:, is_content_available:, is_default_source:)
  @domain = domain
  @is_content_available = is_content_available
  @is_default_source = is_default_source
end

Instance Attribute Details

#domainObject (readonly)

Returns the value of attribute domain.



173
174
175
# File 'lib/finlight/models.rb', line 173

def domain
  @domain
end

#is_content_availableObject (readonly)

Returns the value of attribute is_content_available.



173
174
175
# File 'lib/finlight/models.rb', line 173

def is_content_available
  @is_content_available
end

#is_default_sourceObject (readonly)

Returns the value of attribute is_default_source.



173
174
175
# File 'lib/finlight/models.rb', line 173

def is_default_source
  @is_default_source
end

Class Method Details

.from_h(hash) ⇒ Object



181
182
183
184
185
186
187
# File 'lib/finlight/models.rb', line 181

def self.from_h(hash)
  new(
    domain: hash["domain"],
    is_content_available: hash["isContentAvailable"] == true,
    is_default_source: hash["isDefaultSource"] == true
  )
end