Module: Halogen

Defined in:
lib/halogen.rb,
lib/halogen/links.rb,
lib/halogen/embeds.rb,
lib/halogen/errors.rb,
lib/halogen/railtie.rb,
lib/halogen/version.rb,
lib/halogen/resource.rb,
lib/halogen/hash_util.rb,
lib/halogen/collection.rb,
lib/halogen/definition.rb,
lib/halogen/properties.rb,
lib/halogen/definitions.rb,
lib/halogen/configuration.rb,
lib/halogen/links/definition.rb,
lib/halogen/embeds/definition.rb,
lib/halogen/properties/definition.rb

Overview

HAL+JSON generator

Provides a framework-agnostic interface for generating HAL+JSON representations of resources

Defined Under Namespace

Modules: ClassMethods, Collection, Embeds, HashUtil, InstanceMethods, Links, Properties, Resource Classes: Configuration, Definition, Definitions, InvalidCollection, InvalidDefinition, InvalidResource, Railtie

Constant Summary collapse

VERSION =

:nodoc:

'0.0.3'

Class Method Summary collapse

Class Method Details

.configHalogen::Configuration

Configuration instance


139
140
141
# File 'lib/halogen.rb', line 139

def config
  @config ||= Configuration.new
end

.configure {|Halogen::Configuration| ... } ⇒ Object

Yields:


131
132
133
# File 'lib/halogen.rb', line 131

def configure
  yield config
end

.included(base) ⇒ Module

Provide Halogen methods for the including module

Returns:

  • (Module)

18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/halogen.rb', line 18

def self.included(base)
  base.extend ClassMethods

  base.send :include, InstanceMethods
  base.send :include, Properties
  base.send :include, Links
  base.send :include, Embeds

  config.extensions.each { |extension| base.send :include, extension }

  base.send :attr_reader, :options
end