Class: Para::ModelFieldParsers::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/para/model_field_parsers/base.rb

Direct Known Subclasses

Devise, Globalize, Orderable, Paperclip, Redactor, Relations, Store

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, fields_hash) ⇒ Base

Returns a new instance of Base.



10
11
12
13
# File 'lib/para/model_field_parsers/base.rb', line 10

def initialize(model, fields_hash)
  @model = model
  @fields_hash = fields_hash
end

Instance Attribute Details

#fields_hashObject (readonly)

Returns the value of attribute fields_hash.



8
9
10
# File 'lib/para/model_field_parsers/base.rb', line 8

def fields_hash
  @fields_hash
end

#modelObject (readonly)

Returns the value of attribute model.



8
9
10
# File 'lib/para/model_field_parsers/base.rb', line 8

def model
  @model
end

Class Method Details

.register(key, parser) ⇒ Object



4
5
6
# File 'lib/para/model_field_parsers/base.rb', line 4

def self.register(key, parser)
  ModelFieldParsers.registered_parsers[key] = parser
end

Instance Method Details

#applicable?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/para/model_field_parsers/base.rb', line 15

def applicable?
  true
end