Module: Netilion

Defined in:
lib/netilion.rb,
lib/netilion/edm.rb,
lib/netilion/node.rb,
lib/netilion/unit.rb,
lib/netilion/user.rb,
lib/netilion/asset.rb,
lib/netilion/event.rb,
lib/netilion/record.rb,
lib/netilion/search.rb,
lib/netilion/tenant.rb,
lib/netilion/api_key.rb,
lib/netilion/company.rb,
lib/netilion/product.rb,
lib/netilion/version.rb,
lib/netilion/delivery.rb,
lib/netilion/document.rb,
lib/netilion/netilion.rb,
lib/netilion/node_type.rb,
lib/netilion/quotation.rb,
lib/netilion/threshold.rb,
lib/netilion/user_role.rb,
lib/netilion/attachment.rb,
lib/netilion/edm/record.rb,
lib/netilion/event_type.rb,
lib/netilion/permission.rb,
lib/netilion/user_group.rb,
lib/netilion/asset_value.rb,
lib/netilion/asset_status.rb,
lib/netilion/event_status.rb,
lib/netilion/notification.rb,
lib/netilion/subscription.rb,
lib/netilion/specification.rb,
lib/netilion/authentication.rb,
lib/netilion/product_lookup.rb,
lib/netilion/product_status.rb,
lib/netilion/purchase_order.rb,
lib/netilion/delivery_status.rb,
lib/netilion/document_status.rb,
lib/netilion/edm/edge_device.rb,
lib/netilion/instrumentation.rb,
lib/netilion/api_subscription.rb,
lib/netilion/bill_of_material.rb,
lib/netilion/health_condition.rb,
lib/netilion/product_category.rb,
lib/netilion/quotation_status.rb,
lib/netilion/successor_lookup.rb,
lib/netilion/document_category.rb,
lib/netilion/edm/field_gateway.rb,
lib/netilion/edm/specification.rb,
lib/netilion/client_application.rb,
lib/netilion/edm/software_image.rb,
lib/netilion/permission_request.rb,
lib/netilion/edm/update_schedule.rb,
lib/netilion/edm/edge_device_type.rb,
lib/netilion/edm/software_version.rb,
lib/netilion/instrumentation_type.rb,
lib/netilion/edm/network_interface.rb,
lib/netilion/purchase_order_status.rb,
lib/netilion/request_for_quotation.rb,
lib/netilion/asset_health_condition.rb,
lib/netilion/edm/edge_device_status.rb,
lib/netilion/edm/field_gateway_type.rb,
lib/netilion/health_condition_cause.rb,
lib/netilion/instrumentation_status.rb,
lib/netilion/document_classification.rb,
lib/netilion/edm/software_image_type.rb,
lib/netilion/health_condition_remedy.rb,
lib/netilion/edm/field_gateway_status.rb,
lib/netilion/edm/update_schedule_status.rb,
lib/netilion/extended_order_code_lookup.rb,
lib/netilion/edm/software_version_status.rb,
lib/netilion/request_for_quotation_status.rb

Defined Under Namespace

Modules: EDM, Netilion Classes: APIKey, ApiSubscription, Asset, AssetHealthCondition, AssetStatus, AssetValue, Attachment, Authentication, BillOfMaterial, ClientApplication, Company, Config, Delivery, DeliveryStatus, Document, DocumentCategory, DocumentClassification, DocumentStatus, Event, EventStatus, EventType, ExtendedOrderCodeLookup, HealthCondition, HealthConditionCause, HealthConditionRemedy, Instrumentation, InstrumentationStatus, InstrumentationType, Node, NodeType, Notification, Permission, PermissionRequest, Product, ProductCategory, ProductLookup, ProductStatus, PurchaseOrder, PurchaseOrderStatus, Quotation, QuotationStatus, Record, RequestForQuotation, RequestForQuotationStatus, Search, Specification, Subscription, SuccessorLookup, Tenant, Threshold, Unit, User, UserGroup, UserRole

Constant Summary collapse

VERSION =
'0.1.0'

Class Method Summary collapse

Class Method Details

.api_baseObject



30
31
32
33
34
35
36
37
38
39
# File 'lib/netilion.rb', line 30

def self.api_base
  case config.environment
  when :production
    'https://api.netilion.endress.com'
  when :staging
    'https://api.staging-env.netilion.endress.com'
  when :local
    'http://localhost:3000'
  end
end

.configObject



26
27
28
# File 'lib/netilion.rb', line 26

def self.config
  @config ||= Config.new(environment: :production)
end

.configure(&config_block) ⇒ Object



20
21
22
23
24
# File 'lib/netilion.rb', line 20

def self.configure(&config_block)
  config_block.call config
  set_api_placeholders
  config
end

.set_api_placeholdersObject



41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/netilion.rb', line 41

def self.set_api_placeholders
  LHC.configure do |config|
    config.placeholder(:api, "#{api_base}/v1")
    config.placeholder(:edm, "#{api_base}/v1/edm")

    config.interceptors = [
      Authentication,
      LHC::Auth,
      LHC::Caching
    ]
  end
end