Class: HostedSolr::API::SolrCore

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
lib/hosted_solr/api/solr_core.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def created_at
  @created_at
end

#hostObject

Returns the value of attribute host.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def host
  @host
end

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def id
  @id
end

#internal_nameObject

Returns the value of attribute internal_name.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def internal_name
  @internal_name
end

#is_activatedObject

Returns the value of attribute is_activated.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def is_activated
  @is_activated
end

#nameObject

Returns the value of attribute name.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def name
  @name
end

#passwordObject

Returns the value of attribute password.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def password
  @password
end

#schemaObject

Returns the value of attribute schema.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def schema
  @schema
end

#solr_versionObject

Returns the value of attribute solr_version.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def solr_version
  @solr_version
end

#systemObject

Returns the value of attribute system.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def system
  @system
end

#updated_atObject

Returns the value of attribute updated_at.



9
10
11
# File 'lib/hosted_solr/api/solr_core.rb', line 9

def updated_at
  @updated_at
end

Class Method Details

.from_hash(attributes_hash = {}) ⇒ Object



21
22
23
# File 'lib/hosted_solr/api/solr_core.rb', line 21

def self.from_hash(attributes_hash = {})
  new(attributes_hash.slice(*%w(id solr_version system schema name host internal_name password is_activated created_at updated_at)))
end

Instance Method Details

#connection_uriObject



33
34
35
# File 'lib/hosted_solr/api/solr_core.rb', line 33

def connection_uri
  URI("#{protocol}://#{internal_name}:#{password}@#{host}:#{port}/#{internal_name}/core")
end

#portObject



25
26
27
# File 'lib/hosted_solr/api/solr_core.rb', line 25

def port
  443
end

#protocolObject



29
30
31
# File 'lib/hosted_solr/api/solr_core.rb', line 29

def protocol
  'https'
end